本文整理了Java中org.apache.catalina.connector.Request.getRequestURL
方法的一些代码示例,展示了Request.getRequestURL
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Request.getRequestURL
方法的具体详情如下:
包路径:org.apache.catalina.connector.Request
类名称:Request
方法名:getRequestURL
[英]Reconstructs the URL the client used to make the request. The returned URL contains a protocol, server name, port number, and server path, but it does not include query string parameters.
Because this method returns a StringBuffer
, not a String
, you can modify the URL easily, for example, to append query parameters.
This method is useful for creating redirect messages and for reporting errors.
[中]重建客户端用于发出请求的URL。返回的URL包含协议、服务器名称、端口号和服务器路径,但不包括查询字符串参数。
由于此方法返回的是StringBuffer
,而不是String
,因此您可以轻松地修改URL,例如,添加查询参数。
此方法对于创建重定向消息和报告错误非常有用。
代码示例来源:origin: org.glassfish.main.web/web-core
/**
* Reconstructs the URL the client used to make the request.
* The returned URL contains a protocol, server name, port
* number, and server path, but it does not include query
* string parameters.
* <p>
* Because this method returns a <code>StringBuffer</code>,
* not a <code>String</code>, you can modify the URL easily,
* for example, to append query parameters.
* <p>
* This method is useful for creating redirect messages and
* for reporting errors.
*
* @return A <code>StringBuffer</code> object containing the
* reconstructed URL
*/
@Override
public StringBuffer getRequestURL() {
return getRequestURL(false);
}
代码示例来源:origin: org.glassfish.main.web/web-core
@Override
public StringBuffer getRequestURL() {
if (request == null) {
throw new IllegalStateException(rb.getString(LogFacade.CANNOT_USE_REQUEST_OBJECT_OUTSIDE_SCOPE_EXCEPTION));
}
return request.getRequestURL(maskDefaultContextMapping);
}
代码示例来源:origin: org.apache.tomcat/tomcat-catalina
@Override
public StringBuffer getRequestURL() {
if (request == null) {
throw new IllegalStateException(
sm.getString("requestFacade.nullRequest"));
}
return request.getRequestURL();
}
代码示例来源:origin: codefollower/Tomcat-Research
@Override
public StringBuffer getRequestURL() {
if (request == null) {
throw new IllegalStateException(
sm.getString("requestFacade.nullRequest"));
}
return request.getRequestURL();
}
代码示例来源:origin: org.apache.catalina/com.springsource.org.apache.catalina
@Override
public StringBuffer getRequestURL() {
if (request == null) {
throw new IllegalStateException(
sm.getString("requestFacade.nullRequest"));
}
return request.getRequestURL();
}
代码示例来源:origin: tomcat/catalina
public StringBuffer getRequestURL() {
if (request == null) {
throw new IllegalStateException(
sm.getString("requestFacade.nullRequest"));
}
return request.getRequestURL();
}
代码示例来源:origin: org.apache.geronimo.ext.tomcat/catalina
@Override
public StringBuffer getRequestURL() {
if (request == null) {
throw new IllegalStateException(
sm.getString("requestFacade.nullRequest"));
}
return request.getRequestURL();
}
代码示例来源:origin: org.ops4j.pax.tipi/org.ops4j.pax.tipi.tomcat-embed-core
@Override
public StringBuffer getRequestURL() {
if (request == null) {
throw new IllegalStateException(
sm.getString("requestFacade.nullRequest"));
}
return request.getRequestURL();
}
代码示例来源:origin: com.ovea.tajin.server/tajin-server-jetty9
@Override
public StringBuffer getRequestURL() {
if (request == null) {
throw new IllegalStateException(
sm.getString("requestFacade.nullRequest"));
}
return request.getRequestURL();
}
代码示例来源:origin: com.ovea.tajin.server/tajin-server-tomcat7
@Override
public StringBuffer getRequestURL() {
if (request == null) {
throw new IllegalStateException(
sm.getString("requestFacade.nullRequest"));
}
return request.getRequestURL();
}
代码示例来源:origin: org.jboss.web/jbossweb
public StringBuffer getRequestURL() {
if (request == null) {
throw MESSAGES.nullRequestFacade();
}
return request.getRequestURL();
}
代码示例来源:origin: jboss.web/jbossweb
public StringBuffer getRequestURL() {
if (request == null) {
throw new IllegalStateException(
sm.getString("requestFacade.nullRequest"));
}
return request.getRequestURL();
}
代码示例来源:origin: com.ovea.tajin.servers/tajin-server-jetty9
@Override
public StringBuffer getRequestURL() {
if (request == null) {
throw new IllegalStateException(
sm.getString("requestFacade.nullRequest"));
}
return request.getRequestURL();
}
代码示例来源:origin: org.keycloak/spring-boot-container-bundle
@Override
public String getURI() {
StringBuffer buf = request.getRequestURL();
if (request.getQueryString() != null) {
buf.append('?').append(request.getQueryString());
}
return buf.toString();
}
代码示例来源:origin: org.keycloak/keycloak-tomcat-adapter-spi
@Override
public String getURI() {
StringBuffer buf = request.getRequestURL();
if (request.getQueryString() != null) {
buf.append('?').append(request.getQueryString());
}
return buf.toString();
}
代码示例来源: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;
}
代码示例来源:origin: org.apache.catalina/com.springsource.org.apache.catalina
StringBuffer requestUrl = request.getRequestURL();
if(request.getQueryString()!=null) {
requestUrl.append("?");
代码示例来源:origin: org.jboss.web/jbossweb
StringBuffer requestUrl = request.getRequestURL();
if(request.getQueryString()!=null) {
requestUrl.append("?");
代码示例来源:origin: org.apache.tomcat/tomcat-catalina
StringBuffer requestUrl = request.getRequestURL();
if(request.getQueryString()!=null) {
requestUrl.append("?");
代码示例来源:origin: org.apache.cxf.fediz/fediz-tomcat
request.setCharacterEncoding(this.encoding);
if (request.getRequestURL().indexOf(FederationConstants.METADATA_PATH_URI) != -1) {
if (LOG.isInfoEnabled()) {
LOG.info("WS-Federation Metadata document requested");
内容来源于网络,如有侵权,请联系作者删除!