public class HstContainerRequestImpl extends GenericHttpServletRequestWrapper implements HstContainerRequest
The HstContainerRequestImpl
is a wrapper around the GenericHttpServletRequestWrapper
. As the HstRequestProcessor
is invoked from a Filter
, the original HttpServletRequest
does return an empty HttpServletRequest.getPathInfo()
.
However, in the context of HstRequestProcessor
, the HttpServletRequest.getServletPath()
is equivalent to ResolvedMount.getResolvedMountPath()
and the HttpServletRequest.getPathInfo()
equivalent to the HttpServletRequest.getRequestURI()
after the HttpServletRequest.getServletPath()
(and the same for HttpServletRequest.getPathTranslated()
only then not decoded.).
Therefore, this HstContainerRequestImpl
object has a setter setServletPath(String)
, that recomputes the getPathInfo()
. When the constructor
is called, the servletPath
is set to an empty String
(""). After for example a ResolvedMount
is found, the setServletPath(String)
can be
called to recompute/reset the servletPath
and pathInfo
(and pathTranslated
)
The getPathInfo()
won't return the part in the GenericHttpServletRequestWrapper.getRequestURI()
after the pathSuffixDelimiter
.
The delimiter itself won't be part of the getPathInfo()
either.
Also the return won't include any matrix parameters.
contextPath, pathInfo, pathTranslated, requestURI, requestURL, servletPath
Constructor and Description |
---|
HstContainerRequestImpl(javax.servlet.http.HttpServletRequest request,
String pathSuffixDelimiter)
Creates a wrapper
HttpServletRequest with a HttpServletRequest.getServletPath() that is an empty String (""). |
Modifier and Type | Method and Description |
---|---|
String |
getPathInfo() |
String |
getPathSuffix()
Returns path suffix splitted from the request URI by the specified path suffix delimiter.
|
String |
getPathTranslated() |
StringBuffer |
getRequestURL() |
void |
setServletPath(String servletPath)
Sets a new
servletPath on the HttpServletRequest . |
String |
toString() |
getContextPath, getRequestURI, getServletPath, setContextPath, setPathInfo, setPathTranslated, setRequestURI, setRequestURL
authenticate, getAuthType, getCookies, getDateHeader, getHeader, getHeaderNames, getHeaders, getIntHeader, getMethod, getPart, getParts, getQueryString, getRemoteUser, getRequestedSessionId, getSession, getSession, getUserPrincipal, isRequestedSessionIdFromCookie, isRequestedSessionIdFromUrl, isRequestedSessionIdFromURL, isRequestedSessionIdValid, isUserInRole, login, logout
getAsyncContext, getAttribute, getAttributeNames, getCharacterEncoding, getContentLength, getContentType, getDispatcherType, getInputStream, getLocalAddr, getLocale, getLocales, getLocalName, getLocalPort, getParameter, getParameterMap, getParameterNames, getParameterValues, getProtocol, getReader, getRealPath, getRemoteAddr, getRemoteHost, getRemotePort, getRequest, getRequestDispatcher, getScheme, getServerName, getServerPort, getServletContext, isAsyncStarted, isAsyncSupported, isSecure, isWrapperFor, isWrapperFor, removeAttribute, setAttribute, setCharacterEncoding, setRequest, startAsync, startAsync
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
authenticate, getAuthType, getContextPath, getCookies, getDateHeader, getHeader, getHeaderNames, getHeaders, getIntHeader, getMethod, getPart, getParts, getQueryString, getRemoteUser, getRequestedSessionId, getRequestURI, getServletPath, getSession, getSession, getUserPrincipal, isRequestedSessionIdFromCookie, isRequestedSessionIdFromUrl, isRequestedSessionIdFromURL, isRequestedSessionIdValid, isUserInRole, login, logout
getAsyncContext, getAttribute, getAttributeNames, getCharacterEncoding, getContentLength, getContentType, getDispatcherType, getInputStream, getLocalAddr, getLocale, getLocales, getLocalName, getLocalPort, getParameter, getParameterMap, getParameterNames, getParameterValues, getProtocol, getReader, getRealPath, getRemoteAddr, getRemoteHost, getRemotePort, getRequestDispatcher, getScheme, getServerName, getServerPort, getServletContext, isAsyncStarted, isAsyncSupported, isSecure, removeAttribute, setAttribute, setCharacterEncoding, startAsync, startAsync
public HstContainerRequestImpl(javax.servlet.http.HttpServletRequest request, String pathSuffixDelimiter)
HttpServletRequest
with a HttpServletRequest.getServletPath()
that is an empty String
(""). The
HttpServletRequest.getPathInfo()
will be the part of the HttpServletRequest.getRequestURI()
after the HttpServletRequest.getContextPath()
and before the getPathSuffix()
and before the HstRequestUtils.MATRIX_PARAMS_PATTERN
request
- pathSuffixDelimiter
- public String getPathSuffix()
HstContainerRequest
getPathSuffix
in interface HstContainerRequest
public StringBuffer getRequestURL()
getRequestURL
in interface javax.servlet.http.HttpServletRequest
getRequestURL
in class GenericHttpServletRequestWrapper
public void setServletPath(String servletPath)
Sets a new servletPath
on the HttpServletRequest
. For an HstRequest
, the servletPath
becomes the ResolvedMount.getResolvedMountPath()
of
the ResolvedMount
belonging to the HstRequestContext
.
When the ResolvedMount.getMount()
returns a 'root' Mount
, the servletPath
is an empty string (""). Otherwise, it always starts with a slash "/".
setServletPath
in class GenericHttpServletRequestWrapper
servletPath
- ResolvedMount.getResolvedMountPath()
public String getPathInfo()
getPathInfo
in interface javax.servlet.http.HttpServletRequest
getPathInfo
in class GenericHttpServletRequestWrapper
public String getPathTranslated()
getPathTranslated
in interface javax.servlet.http.HttpServletRequest
getPathTranslated
in class GenericHttpServletRequestWrapper
Copyright © 2008–2016 Hippo B.V. (http://www.onehippo.com). All rights reserved.