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

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

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

HttpServletRequestWrapper.getContextPath介绍

[英]The default behavior of this method is to return getContextPath() on the wrapped request object.
[中]此方法的默认行为是在包装的请求对象上返回getContextPath()。

代码示例

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

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

代码示例来源:origin: org.apache.cxf/cxf-rt-transports-http

@Override
  public String getPathInfo() {
    if (pathInfo == null) {
      pathInfo = super.getPathInfo();
      if (pathInfo == null) {
        pathInfo = getRequestURI();
      }
      String prefix = super.getContextPath() + this.getServletPath();
      if (pathInfo.startsWith(prefix)) {
        pathInfo = pathInfo.substring(prefix.length());
      }
    }
    return pathInfo;
  }
}

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

@Override
public String getContextPath()
{
  String contextPath = super.getContextPath();
  return contextPath;
}

代码示例来源:origin: org.seasar.kvasir.cms/org.seasar.kvasir.cms

public String getContextPath()
{
  if (activated_) {
    return contextPath_;
  } else {
    return super.getContextPath();
  }
}

代码示例来源:origin: com.github.wuic/wuic-servlet

/**
 * {@inheritDoc}
 */
@Override
public String getContextPath() {
  // Synchronized access
  synchronized (mutex) {
    return super.getContextPath();
  }
}

代码示例来源:origin: org.apache.wicket/wicket-atmosphere

@Override
  public String getContextPath()
  {
    String ret = super.getContextPath();
    return ret == null ? "" : ret;
  }
};

代码示例来源:origin: org.apache.wicket.experimental.wicket8/wicket-atmosphere

@Override
  public String getContextPath()
  {
    String ret = super.getContextPath();
    return ret == null ? "" : ret;
  }
};

代码示例来源:origin: org.geoserver/gs-gwc

@Override
public String getContextPath() {
  // to GWC the workspace is part of the request context
  if (localPublishedName == null) {
    return super.getContextPath() + "/" + localWorkspaceName;
  } else {
    return super.getContextPath() + "/" + localWorkspaceName + "/" + localPublishedName;
  }
}

代码示例来源:origin: GeoWebCache/geowebcache

@Override
  public String getContextPath() {
    return super.getContextPath() + ("".equals(prefix) ? "" : "/" + prefix);
  }
},

代码示例来源:origin: spring-projects/spring-batch-admin

@Override
public String getContextPath() {
  String base = super.getContextPath();
  if (pathParams!=null && pathParams.isEmpty()) {
    return base;
  }
  StringBuffer buffer = new StringBuffer(base);
  for (String key : pathParams) {
    buffer.append("/" + key);
  }
  return buffer.toString();
}

代码示例来源:origin: org.springframework.batch/spring-batch-admin-resources

@Override
public String getContextPath() {
  String base = super.getContextPath();
  if (pathParams!=null && pathParams.isEmpty()) {
    return base;
  }
  StringBuffer buffer = new StringBuffer(base);
  for (String key : pathParams) {
    buffer.append("/" + key);
  }
  return buffer.toString();
}

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

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

代码示例来源:origin: org.hudsonci.stapler/stapler-core

public String getRootPath() {
  StringBuffer buf = super.getRequestURL();
  int idx = 0;
  for( int i=0; i<3; i++ )
    idx += buf.substring(idx).indexOf("/")+1;
  buf.setLength(idx-1);
  buf.append(super.getContextPath());
  return buf.toString();
}

代码示例来源:origin: org.kohsuke.stapler/stapler

public String getRootPath() {
  StringBuffer buf = super.getRequestURL();
  int idx = 0;
  for( int i=0; i<3; i++ )
    idx += buf.substring(idx).indexOf("/")+1;
  buf.setLength(idx-1);
  buf.append(super.getContextPath());
  return buf.toString();
}

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

@Override /* HttpServletRequest */
public String getContextPath() {
  String cp = context.getUriContext();
  return cp == null ? super.getContextPath() : cp;
}

代码示例来源:origin: Jasig/uPortal

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

代码示例来源:origin: org.sakaiproject.kernel/sakai-kernel-impl

public String getContextPath()
{
  if (getAttribute(NATIVE_URL) != null) return super.getContextPath();
  return m_context;
}

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

@Override
  public String getPathInfo() {
    if (pathInfo == null) {
      pathInfo = super.getPathInfo();
      if (pathInfo == null) {
        pathInfo = getRequestURI();
      }
      String prefix = super.getContextPath() + this.getServletPath();
      if (pathInfo.startsWith(prefix)) {
        pathInfo = pathInfo.substring(prefix.length());
      }
    }
    return pathInfo;
  }
}

代码示例来源:origin: org.jvnet.hudson.winstone/winstone

public String getContextPath() {
  if (hasBeenForwarded()) {
    return super.getContextPath();
  } else {
    return this.oldRequest.getContextPath();
  }
}

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

public String getContextPath()
  {
    try
    {
      return super.getContextPath();
    }
    catch (NullPointerException e) // Resin throws a NullPointerException in some cases - JRA-11038
    {
      return new DefaultVelocityRequestContextFactory(ComponentAccessor.getApplicationProperties()).getJiraVelocityRequestContext().getBaseUrl();
    }
  }
};

相关文章

HttpServletRequestWrapper类方法