javax.servlet.http.HttpServletRequestWrapper.getServletPath()方法的使用及代码示例

x33g5p2x  于2022-01-19 转载在 其他  
字(4.4k)|赞(0)|评价(0)|浏览(256)

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

HttpServletRequestWrapper.getServletPath介绍

[英]The default behavior of this method is to return getServletPath() on the wrapped request object.
[中]

代码示例

代码示例来源:origin: cloudfoundry/uaa

@Override
public String getServletPath() {
  return super.getServletPath();
}

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

wrapper.getRequestDispatcher(wrapper.getServletPath()).forward(wrapper, response);
return true;

代码示例来源:origin: com.google.inject.extensions/guice-servlet

private String computePath() {
  if (!isPathComputed()) {
   String servletPath = super.getServletPath();
   path = patternMatcher.extractPath(servletPath);
   pathComputed = true;
   if (null == path) {
    path = servletPath;
   }
  }
  return path;
 }
};

代码示例来源:origin: org.eclipse.jetty.aggregate/jetty-all-server

public String getServletPath()
{
  if (_included)
    return super.getServletPath();
  return _servletPath;
}

代码示例来源:origin: org.eclipse.jetty.aggregate/jetty-webapp

public String getServletPath()
{
  if (_included)
    return super.getServletPath();
  return _servletPath;
}

代码示例来源:origin: org.mortbay.jetty/com.springsource.org.mortbay.jetty.server

public String getServletPath()
{
  if (_included)
    return super.getServletPath();
  return _servletPath;
}

代码示例来源:origin: org.gosu-lang.gosu.managed/gw-jetty

public String getServletPath()
{
  if (_included)
    return super.getServletPath();
  return _servletPath;
}

代码示例来源:origin: com.atlassian.jira/jira-core

@Override
public String getServletPath()
{
  String servletPath = super.getServletPath();
  return servletPath;
}

代码示例来源:origin: jenkinsci/winstone

@Override
public String getServletPath()
{
  if (_included)
    return super.getServletPath();
  return _servletPath;
}

代码示例来源:origin: com.uwyn/jhighlight

public String getServletPath()
{
  String path = super.getServletPath();
  return path.substring(0, path.length() - 1);
}

代码示例来源:origin: org.codelibs/jhighlight

public String getServletPath()
{
  String path = super.getServletPath();
  return path.substring(0, path.length() - 1);
}

代码示例来源:origin: org.apache.felix/org.apache.felix.http.base

@Override
public String getServletPath()
{
  if ( isInclusionDispatcher() )
  {
    return super.getServletPath();
  }
  return this.requestInfo.servletPath;
}

代码示例来源:origin: apache/felix

@Override
public String getServletPath()
{
  if ( isInclusionDispatcher() )
  {
    return super.getServletPath();
  }
  return this.requestInfo.servletPath;
}

代码示例来源:origin: org.jasig.portal/uPortal-rendering

@Override
public String getServletPath() {
  this.checkState();
  return super.getServletPath();
}

代码示例来源:origin: apache/juneau

@Override /* HttpServletRequest */
public String getServletPath() {
  String cp = context.getUriContext();
  String sp = super.getServletPath();
  return cp == null || ! sp.startsWith(cp) ? sp : sp.substring(cp.length());
}

代码示例来源:origin: com.vaadin/vaadin-spring

@Override
public String getServletPath() {
  String pathInfo = super.getPathInfo();
  if (pathInfo == null) {
    // the path where a ServletForwardingController is registered is not
    // a real servlet path
    return "";
  } else {
    return super.getServletPath();
  }
}

代码示例来源:origin: org.apache.juneau/juneau-rest-server

@Override /* HttpServletRequest */
public String getServletPath() {
  String cp = context.getUriContext();
  String sp = super.getServletPath();
  return cp == null || ! sp.startsWith(cp) ? sp : sp.substring(cp.length());
}

代码示例来源:origin: org.apache.tuscany.sca/tuscany-base-runtime

@Override
  public String getPathInfo() {
    String path = super.getServletPath();
    if (path.length() == 0) {
      path = super.getPathInfo();
    }
    // TODO: another context path hack, revisit when context path is sorted out
    path = fiddlePath(path, servletPath);
    return path;
  }
};

代码示例来源:origin: org.sonatype.sisu.inject/guice-servlet

private String computePath() {
  if (!isPathComputed()) {
   String servletPath = super.getServletPath();
   path = patternMatcher.extractPath(servletPath);
   pathComputed = true;
   if (null == path) {
    path = servletPath;
   }
  }
  return path;
 }
};

代码示例来源:origin: info.magnolia/magnolia-core

@Override
  public Void answer(InvocationOnMock invocation) throws Throwable {
    Object[] args = invocation.getArguments();
    final HttpServletRequestWrapper requestWrapper = (HttpServletRequestWrapper) args[0];
    final String pathInfo = requestWrapper.getPathInfo();
    final String servletPath = requestWrapper.getServletPath();
    assertEquals("pathInfo does not match", expectedPathInfo, pathInfo);
    assertEquals("servletPath does not match", expectedServletPath, servletPath);
    return null;
  }
}).when(servlet).service(any(HttpServletRequestWrapper.class), same(res));

相关文章

HttpServletRequestWrapper类方法