org.apache.catalina.connector.Request.getContextPath()方法的使用及代码示例

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

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

Request.getContextPath介绍

[英]Return the portion of the request URI used to select the Context of the Request.
[中]返回用于选择请求上下文的请求URI部分。

代码示例

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

/**
 * Return the portion of the request URI used to select the Context
 * of the Request.
 */
@Override
public String getContextPath() {
  return getContextPath(false);
}

代码示例来源:origin: org.apache.geronimo.modules/geronimo-tomcat6

public String getContextPath() {
  return request.getContextPath();
}

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

@Override
public String getContextPath() {
  if (request == null) {
    throw new IllegalStateException(rb.getString(LogFacade.CANNOT_USE_REQUEST_OBJECT_OUTSIDE_SCOPE_EXCEPTION));
  }
  return request.getContextPath(maskDefaultContextMapping);
}

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

public String getContextPath(boolean maskDefaultContextMapping) {
  if (request == null) {
    throw new IllegalStateException(rb.getString(LogFacade.CANNOT_USE_REQUEST_OBJECT_OUTSIDE_SCOPE_EXCEPTION));
  }
  return request.getContextPath(maskDefaultContextMapping);
}

代码示例来源:origin: org.apache.tomcat/tomcat-catalina

@Override
public String getContextPath() {
  if (request == null) {
    throw new IllegalStateException(
            sm.getString("requestFacade.nullRequest"));
  }
  return request.getContextPath();
}

代码示例来源:origin: org.apache.geronimo.ext.tomcat/catalina

@Override
public String getContextPath() {
  if (request == null) {
    throw new IllegalStateException(
            sm.getString("requestFacade.nullRequest"));
  }
  return request.getContextPath();
}

代码示例来源:origin: org.apache.catalina/com.springsource.org.apache.catalina

@Override
public String getContextPath() {
  if (request == null) {
    throw new IllegalStateException(
            sm.getString("requestFacade.nullRequest"));
  }
  return request.getContextPath();
}

代码示例来源:origin: codefollower/Tomcat-Research

@Override
public String getContextPath() {
  if (request == null) {
    throw new IllegalStateException(
            sm.getString("requestFacade.nullRequest"));
  }
  return request.getContextPath();
}

代码示例来源:origin: tomcat/catalina

public String getContextPath() {
  if (request == null) {
    throw new IllegalStateException(
            sm.getString("requestFacade.nullRequest"));
  }
  return request.getContextPath();
}

代码示例来源:origin: org.keycloak/spring-boot-container-bundle

@Override
public String getRelativePath() {
  String uri = request.getRequestURI();
  String contextPath = request.getContextPath();
  String servletPath = uri.substring(uri.indexOf(contextPath) + contextPath.length());
  if ("".equals(servletPath)) {
    servletPath = "/";
  }
  return servletPath;
}

代码示例来源:origin: org.ops4j.pax.tipi/org.ops4j.pax.tipi.tomcat-embed-core

@Override
public String getContextPath() {
  if (request == null) {
    throw new IllegalStateException(
            sm.getString("requestFacade.nullRequest"));
  }
  return request.getContextPath();
}

代码示例来源:origin: com.ovea.tajin.servers/tajin-server-jetty9

@Override
public String getContextPath() {
  if (request == null) {
    throw new IllegalStateException(
            sm.getString("requestFacade.nullRequest"));
  }
  return request.getContextPath();
}

代码示例来源:origin: org.jboss.web/jbossweb

public String getContextPath() {
  if (request == null) {
    throw MESSAGES.nullRequestFacade();
  }
  return request.getContextPath();
}

代码示例来源:origin: jboss.web/jbossweb

public String getContextPath() {
  if (request == null) {
    throw new IllegalStateException(
            sm.getString("requestFacade.nullRequest"));
  }
  return request.getContextPath();
}

代码示例来源:origin: org.keycloak/keycloak-tomcat-adapter-spi

@Override
public String getRelativePath() {
  String uri = request.getRequestURI();
  String contextPath = request.getContextPath();
  String servletPath = uri.substring(uri.indexOf(contextPath) + contextPath.length());
  if ("".equals(servletPath)) {
    servletPath = "/";
  }
  return servletPath;
}

代码示例来源:origin: com.ovea.tajin.server/tajin-server-tomcat7

@Override
public String getContextPath() {
  if (request == null) {
    throw new IllegalStateException(
            sm.getString("requestFacade.nullRequest"));
  }
  return request.getContextPath();
}

代码示例来源:origin: com.ovea.tajin.server/tajin-server-jetty9

@Override
public String getContextPath() {
  if (request == null) {
    throw new IllegalStateException(
            sm.getString("requestFacade.nullRequest"));
  }
  return request.getContextPath();
}

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

String getContextPath(boolean maskDefaultContextMapping) {
  validateRequest();
  return request.getContextPath(maskDefaultContextMapping);
}

代码示例来源:origin: org.graniteds/granite-server

protected Realm getRealm(Request request) {
  String serverName = request.getServerName();
  String contextPath = request.getContextPath();
  
  Context context = request.getContext();
  if (context == null)
    throw new NullPointerException("Could not find Tomcat context for: " + contextPath);
  Realm realm = context.getRealm();
  if (realm == null)
    throw new NullPointerException("Could not find Tomcat realm for: " + serverName + "" + contextPath);
  return realm;
}

代码示例来源:origin: org.keycloak/keycloak-saml-tomcat-adapter-core

@Override
public String getRedirectUri() {
  String redirect = (String)getSession(true).getAttribute(SAML_REDIRECT_URI);
  if (redirect == null) {
    String contextPath = request.getContextPath();
    String baseUri = KeycloakUriBuilder.fromUri(request.getRequestURL().toString()).replacePath(contextPath).build().toString();
    return SamlUtil.getRedirectTo(facade, contextPath, baseUri);
  }
  return redirect;
}

相关文章

微信公众号

最新文章

更多

Request类方法