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

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

本文整理了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

  1. @Override
  2. public String getContextPath() {
  3. return super.getContextPath();
  4. }

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

  1. @Override
  2. public String getPathInfo() {
  3. if (pathInfo == null) {
  4. pathInfo = super.getPathInfo();
  5. if (pathInfo == null) {
  6. pathInfo = getRequestURI();
  7. }
  8. String prefix = super.getContextPath() + this.getServletPath();
  9. if (pathInfo.startsWith(prefix)) {
  10. pathInfo = pathInfo.substring(prefix.length());
  11. }
  12. }
  13. return pathInfo;
  14. }
  15. }

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

  1. @Override
  2. public String getContextPath()
  3. {
  4. String contextPath = super.getContextPath();
  5. return contextPath;
  6. }

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

  1. public String getContextPath()
  2. {
  3. if (activated_) {
  4. return contextPath_;
  5. } else {
  6. return super.getContextPath();
  7. }
  8. }

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

  1. /**
  2. * {@inheritDoc}
  3. */
  4. @Override
  5. public String getContextPath() {
  6. // Synchronized access
  7. synchronized (mutex) {
  8. return super.getContextPath();
  9. }
  10. }

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

  1. @Override
  2. public String getContextPath()
  3. {
  4. String ret = super.getContextPath();
  5. return ret == null ? "" : ret;
  6. }
  7. };

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

  1. @Override
  2. public String getContextPath()
  3. {
  4. String ret = super.getContextPath();
  5. return ret == null ? "" : ret;
  6. }
  7. };

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

  1. @Override
  2. public String getContextPath() {
  3. // to GWC the workspace is part of the request context
  4. if (localPublishedName == null) {
  5. return super.getContextPath() + "/" + localWorkspaceName;
  6. } else {
  7. return super.getContextPath() + "/" + localWorkspaceName + "/" + localPublishedName;
  8. }
  9. }

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

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

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

  1. @Override
  2. public String getContextPath() {
  3. String base = super.getContextPath();
  4. if (pathParams!=null && pathParams.isEmpty()) {
  5. return base;
  6. }
  7. StringBuffer buffer = new StringBuffer(base);
  8. for (String key : pathParams) {
  9. buffer.append("/" + key);
  10. }
  11. return buffer.toString();
  12. }

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

  1. @Override
  2. public String getContextPath() {
  3. String base = super.getContextPath();
  4. if (pathParams!=null && pathParams.isEmpty()) {
  5. return base;
  6. }
  7. StringBuffer buffer = new StringBuffer(base);
  8. for (String key : pathParams) {
  9. buffer.append("/" + key);
  10. }
  11. return buffer.toString();
  12. }

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

  1. @Override
  2. public String getContextPath() {
  3. this.checkState();
  4. return super.getContextPath();
  5. }

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

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

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

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

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

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

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

  1. @Override
  2. public String getContextPath() {
  3. this.checkState();
  4. return super.getContextPath();
  5. }

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

  1. public String getContextPath()
  2. {
  3. if (getAttribute(NATIVE_URL) != null) return super.getContextPath();
  4. return m_context;
  5. }

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

  1. @Override
  2. public String getPathInfo() {
  3. if (pathInfo == null) {
  4. pathInfo = super.getPathInfo();
  5. if (pathInfo == null) {
  6. pathInfo = getRequestURI();
  7. }
  8. String prefix = super.getContextPath() + this.getServletPath();
  9. if (pathInfo.startsWith(prefix)) {
  10. pathInfo = pathInfo.substring(prefix.length());
  11. }
  12. }
  13. return pathInfo;
  14. }
  15. }

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

  1. public String getContextPath() {
  2. if (hasBeenForwarded()) {
  3. return super.getContextPath();
  4. } else {
  5. return this.oldRequest.getContextPath();
  6. }
  7. }

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

  1. public String getContextPath()
  2. {
  3. try
  4. {
  5. return super.getContextPath();
  6. }
  7. catch (NullPointerException e) // Resin throws a NullPointerException in some cases - JRA-11038
  8. {
  9. return new DefaultVelocityRequestContextFactory(ComponentAccessor.getApplicationProperties()).getJiraVelocityRequestContext().getBaseUrl();
  10. }
  11. }
  12. };

相关文章

HttpServletRequestWrapper类方法