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

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

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

Request.getDecodedRequestURI介绍

[英]Get the decoded request URI.
[中]获取已解码的请求URI。

代码示例

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

protected String getRelativeURI(final Request request) throws Exception {
  String uri = request.getDecodedRequestURI();
  if (uri.contains("..")) {
    return null;
  }
  final String resourcesContextPath = request.getContextPath();
  if (resourcesContextPath != null && !resourcesContextPath.isEmpty()) {
    if (!uri.startsWith(resourcesContextPath)) {
      return null;
    }
    uri = uri.substring(resourcesContextPath.length());
  }
  return uri;
}

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

protected String getRelativeURI(final Request request) throws Exception {
  String uri = request.getDecodedRequestURI();
  if (uri.contains("..")) {
    return null;
  }
  final String resourcesContextPath = request.getContextPath();
  if (resourcesContextPath != null && !resourcesContextPath.isEmpty()) {
    if (!uri.startsWith(resourcesContextPath)) {
      return null;
    }
    uri = uri.substring(resourcesContextPath.length());
  }
  return uri;
}

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

protected String getRelativeURI(final Request request) throws Exception {
  String uri = request.getDecodedRequestURI();
  if (uri.contains("..")) {
    return null;
  }
  final String resourcesContextPath = request.getContextPath();
  if (resourcesContextPath != null && !resourcesContextPath.isEmpty()) {
    if (!uri.startsWith(resourcesContextPath)) {
      return null;
    }
    uri = uri.substring(resourcesContextPath.length());
  }
  return uri;
}

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

protected String getRelativeURI(final Request request) throws Exception {
  String uri = request.getDecodedRequestURI();
  if (uri.contains("..")) {
    return null;
  }
  final String resourcesContextPath = request.getContextPath();
  if (resourcesContextPath != null && !resourcesContextPath.isEmpty()) {
    if (!uri.startsWith(resourcesContextPath)) {
      return null;
    }
    uri = uri.substring(resourcesContextPath.length());
  }
  return uri;
}

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

protected String getRelativeURI(final Request request) throws Exception {
  String uri = request.getDecodedRequestURI();
  if (uri.contains("..")) {
    return null;
  }
  final String resourcesContextPath = request.getContextPath();
  if (resourcesContextPath != null && !resourcesContextPath.isEmpty()) {
    if (!uri.startsWith(resourcesContextPath)) {
      return null;
    }
    uri = uri.substring(resourcesContextPath.length());
  }
  return uri;
}

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

protected String getRelativeURI(final Request request) throws Exception {
  String uri = request.getDecodedRequestURI();
  if (uri.contains("..")) {
    return null;
  }
  final String resourcesContextPath = request.getContextPath();
  if (resourcesContextPath != null && !resourcesContextPath.isEmpty()) {
    if (!uri.startsWith(resourcesContextPath)) {
      return null;
    }
    uri = uri.substring(resourcesContextPath.length());
  }
  return uri;
}

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

protected String getRelativeURI(final Request request) throws Exception {
  String uri = request.getDecodedRequestURI();
  if (uri.contains("..")) {
    return null;
  }
  final String resourcesContextPath = request.getContextPath();
  if (resourcesContextPath != null && !resourcesContextPath.isEmpty()) {
    if (!uri.startsWith(resourcesContextPath)) {
      return null;
    }
    uri = uri.substring(resourcesContextPath.length());
  }
  return uri;
}

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

protected String getRelativeURI(final Request request) throws Exception {
  String uri = request.getDecodedRequestURI();
  if (uri.contains("..")) {
    return null;
  }
  final String resourcesContextPath = request.getContextPath();
  if (resourcesContextPath != null && !resourcesContextPath.isEmpty()) {
    if (!uri.startsWith(resourcesContextPath)) {
      return null;
    }
    uri = uri.substring(resourcesContextPath.length());
  }
  return uri;
}

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

protected String getRelativeURI(final Request request) throws Exception {
  String uri = request.getDecodedRequestURI();
  if (uri.contains("..")) {
    return null;
  }
  final String resourcesContextPath = request.getContextPath();
  if (resourcesContextPath != null && !resourcesContextPath.isEmpty()) {
    if (!uri.startsWith(resourcesContextPath)) {
      return null;
    }
    uri = uri.substring(resourcesContextPath.length());
  }
  return uri;
}

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

protected String getRelativeURI(final Request request) throws Exception {
  String uri = request.getDecodedRequestURI();
  if (uri.contains("..")) {
    return null;
  }
  final String resourcesContextPath = request.getContextPath();
  if (resourcesContextPath != null && !resourcesContextPath.isEmpty()) {
    if (!uri.startsWith(resourcesContextPath)) {
      return null;
    }
    uri = uri.substring(resourcesContextPath.length());
  }
  return uri;
}

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

protected String getRelativeURI(final Request request) throws Exception {
  String uri = request.getDecodedRequestURI();
  if (uri.contains("..")) {
    return null;
  }
  final String resourcesContextPath = request.getContextPath();
  if (resourcesContextPath != null && !resourcesContextPath.isEmpty()) {
    if (!uri.startsWith(resourcesContextPath)) {
      return null;
    }
    uri = uri.substring(resourcesContextPath.length());
  }
  return uri;
}

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

/**
 * Gets the decoded request URI.
 *
 * @param maskDefaultContextMapping true if the fact that a request
 * received at the root context was mapped to a default-web-module will
 * be masked, false otherwise
 */
public String getDecodedRequestURI(boolean maskDefaultContextMapping) {
  try {
    if (maskDefaultContextMapping || !isDefaultContext) {
      return coyoteRequest.getDecodedRequestURI();
    } else {
      return getContextPath() + coyoteRequest.getDecodedRequestURI();
    }
  } catch (CharConversionException e) {
    throw new RuntimeException(e.getMessage(), e);
  }
}

代码示例来源:origin: com.conveyal/osm-lib

String uri = request.getDecodedRequestURI();
int suffixIndex = uri.lastIndexOf('.');
String fileType = uri.substring(suffixIndex);

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

String relativePath = request.getDecodedRequestURI();
final int pos = relativePath.lastIndexOf('/');
relativePath = relativePath.substring(0, pos);

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

String relativePath = request.getDecodedRequestURI();
final int pos = relativePath.lastIndexOf('/');
relativePath = relativePath.substring(0, pos);

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

final String path = request.getDecodedRequestURI();

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

String requestURI = request.getDecodedRequestURI();
logger.debug("OSGiResourceHandler requestURI: " + requestURI);
String path = requestURI.replaceFirst(alias, prefix);

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

String requestURI = request.getDecodedRequestURI();
logger.debug("OSGiResourceHandler requestURI: " + requestURI);
String path = requestURI.replaceFirst(alias, prefix);

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

public void service(Request request, Response response) throws Exception {
  boolean invoked = false;
  String alias = request.getDecodedRequestURI();
  String originalAlias = alias;
  logger.debug("Serviceing URI: " + alias);

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

public void service(Request request, Response response) throws Exception {
  boolean invoked = false;
  String alias = request.getDecodedRequestURI();
  String originalAlias = alias;
  logger.debug("Serviceing URI: " + alias);

相关文章

Request类方法