org.glassfish.grizzly.http.server.Request.getRequestURI()方法的使用及代码示例

x33g5p2x  于2022-01-28 转载在 其他  
字(5.3k)|赞(0)|评价(0)|浏览(185)

本文整理了Java中org.glassfish.grizzly.http.server.Request.getRequestURI方法的一些代码示例,展示了Request.getRequestURI的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Request.getRequestURI方法的具体详情如下:
包路径:org.glassfish.grizzly.http.server.Request
类名称:Request
方法名:getRequestURI

Request.getRequestURI介绍

[英]Return the request URI for this request.
[中]返回此请求的请求URI。

代码示例

代码示例来源:origin: jersey/jersey

private URI getRequestUri(final Request request) {
  try {
    final String serverAddress = getServerAddress(request);
    String uri;
    if (configReduceContextPathSlashesEnabled && containsContextPath(request)) {
      uri = ContainerUtils.reduceLeadingSlashes(request.getRequestURI());
    } else {
      uri = request.getRequestURI();
    }
    final String queryString = request.getQueryString();
    if (queryString != null) {
      uri = uri + "?" + ContainerUtils.encodeUnsafeCharacters(queryString);
    }
    return new URI(serverAddress + uri);
  } catch (URISyntaxException ex) {
    throw new IllegalArgumentException(ex);
  }
}

代码示例来源:origin: jersey/jersey

@Override
public void service(Request request, Response response) throws Exception {
  String uri = request.getRequestURI();

代码示例来源:origin: org.glassfish.grizzly/grizzly-websockets-server

@Override
  StringBuilder format(StringBuilder builder, Request request, Response response, Date timeStamp, long responseNanos) {
    final String uri = request.getRequestURI();
    return builder.append(uri == null ? "-" : uri);
  }
}

代码示例来源:origin: javaee/grizzly

@Override
  StringBuilder format(StringBuilder builder, Request request, Response response, Date timeStamp, long responseNanos) {
    final String uri = request.getRequestURI();
    return builder.append(uri == null ? "-" : uri);
  }
}

代码示例来源:origin: javaee/grizzly

/**
 * {@inheritDoc}
 */
@Override
public String getRequestURI() {
  if (request == null) {
    throw new IllegalStateException("Null request object");
  }
  return request.getRequestURI();
}

代码示例来源:origin: javaee/grizzly

@Override
  StringBuilder format(StringBuilder builder, Request request, Response response, Date timeStamp, long responseNanos) {
    final String uri = request.getRequestURI();
    return builder.append(uri == null ? "-" : uri);
  }
}

代码示例来源:origin: javaee/grizzly

@Override
  StringBuilder format(StringBuilder builder, Request request, Response response, Date timeStamp, long responseNanos) {
    final String uri = request.getRequestURI();
    return builder.append(uri == null ? "-" : uri);
  }
}

代码示例来源:origin: javaee/grizzly

/**
 * {@inheritDoc}
 */
@Override
public String getRequestURI() {
  if (request == null) {
    throw new IllegalStateException("Null request object");
  }
  return request.getRequestURI();
}

代码示例来源:origin: javaee/grizzly

@Override
  StringBuilder format(StringBuilder builder, Request request, Response response, Date timeStamp, long responseNanos) {
    final String uri = request.getRequestURI();
    return builder.append(uri == null ? "-" : uri);
  }
}

代码示例来源:origin: javaee/grizzly

/**
 * {@inheritDoc}
 */
@Override
public String getRequestURI() {
  if (request == null) {
    throw new IllegalStateException("Null request object");
  }
  return request.getRequestURI();
}

代码示例来源:origin: org.glassfish.grizzly/grizzly-http-server

@Override
  StringBuilder format(StringBuilder builder, Request request, Response response, Date timeStamp, long responseNanos) {
    final String uri = request.getRequestURI();
    return builder.append(uri == null ? "-" : uri);
  }
}

代码示例来源:origin: javaee/grizzly

@Override
  StringBuilder format(StringBuilder builder, Request request, Response response, Date timeStamp, long responseNanos) {
    final String uri = request.getRequestURI();
    return builder.append(uri == null ? "-" : uri);
  }
}

代码示例来源:origin: javaee/grizzly

/**
 * {@inheritDoc}
 */
@Override
public String getRequestURI() {
  if (request == null) {
    throw new IllegalStateException("Null request object");
  }
  return request.getRequestURI();
}

代码示例来源:origin: javaee/grizzly

@Override
  StringBuilder format(StringBuilder builder, Request request, Response response, Date timeStamp, long responseNanos) {
    final String uri = request.getRequestURI();
    return builder.append(uri == null ? "-" : uri);
  }
}

代码示例来源:origin: javaee/grizzly

@Override
  StringBuilder format(StringBuilder builder, Request request, Response response, Date timeStamp, long responseNanos) {
    final String uri = request.getRequestURI();
    return builder.append(uri == null ? "-" : uri);
  }
}

代码示例来源:origin: org.glassfish.grizzly/grizzly-websockets-server

/**
 * {@inheritDoc}
 */
@Override
public String getRequestURI() {
  if (request == null) {
    throw new IllegalStateException("Null request object");
  }
  return request.getRequestURI();
}

代码示例来源:origin: javaee/grizzly

/**
 * {@inheritDoc}
 */
@Override
public String getRequestURI() {
  if (request == null) {
    throw new IllegalStateException("Null request object");
  }
  return request.getRequestURI();
}

代码示例来源:origin: org.mule.glassfish.grizzly/grizzly-http-server

@Override
  StringBuilder format(StringBuilder builder, Request request, Response response, Date timeStamp, long responseNanos) {
    final String uri = request.getRequestURI();
    return builder.append(uri == null ? "-" : uri);
  }
}

代码示例来源:origin: org.glassfish.grizzly/grizzly-http-server-core

@Override
  StringBuilder format(StringBuilder builder, Request request, Response response, Date timeStamp, long responseNanos) {
    final String uri = request.getRequestURI();
    return builder.append(uri == null ? "-" : uri);
  }
}

代码示例来源:origin: org.glassfish.main.core/kernel

/**
 * @param req the Request
 * @return <code>true</code> if the request is for a resource with a known content
 *  type otherwise <code>false</code>.
 */
private boolean isResourceRequest(Request req) {
  return (getContentType(req.getRequestURI()) != null);
}

相关文章

Request类方法