public class SavedRequestAwareWrapper extends SecurityContextHolderAwareRequestWrapper
Note that not all request parameters in the original request are emulated by this wrapper. Nevertheless, the important data from the original request is emulated and this should prove adequate for most purposes (in particular standard HTTP GET and POST operations).
Added into a request by SecurityContextHolderAwareRequestFilter
.
SecurityContextHolderAwareRequestFilter
Modifier and Type | Field and Description |
---|---|
protected static java.util.Locale |
defaultLocale
The default Locale if none are specified.
|
protected java.text.SimpleDateFormat[] |
formats
The set of SimpleDateFormat formats to use in getDateHeader().
|
protected static java.util.TimeZone |
GMT_ZONE |
protected static org.apache.commons.logging.Log |
logger |
protected SavedRequest |
savedRequest |
Constructor and Description |
---|
SavedRequestAwareWrapper(javax.servlet.http.HttpServletRequest request,
PortResolver portResolver,
java.lang.String rolePrefix) |
Modifier and Type | Method and Description |
---|---|
javax.servlet.http.Cookie[] |
getCookies() |
long |
getDateHeader(java.lang.String name) |
java.lang.String |
getHeader(java.lang.String name) |
java.util.Enumeration |
getHeaderNames() |
java.util.Enumeration |
getHeaders(java.lang.String name) |
int |
getIntHeader(java.lang.String name) |
java.util.Locale |
getLocale() |
java.util.Enumeration |
getLocales() |
java.lang.String |
getMethod() |
java.lang.String |
getParameter(java.lang.String name)
If the parameter is available from the wrapped request then either
There is no saved request (it a normal request)
There is a saved request, but the request has been forwarded/included to a URL with parameters, either
supplementing or overriding the saved request values.
In both cases the value from the wrapped request should be used.
|
java.util.Map |
getParameterMap() |
java.util.Enumeration |
getParameterNames() |
java.lang.String[] |
getParameterValues(java.lang.String name) |
getRemoteUser, getUserPrincipal, isUserInRole
authenticate, changeSessionId, getAuthType, getContextPath, getPart, getParts, getPathInfo, getPathTranslated, getQueryString, getRequestedSessionId, getRequestURI, getRequestURL, getServletPath, getSession, getSession, isRequestedSessionIdFromCookie, isRequestedSessionIdFromUrl, isRequestedSessionIdFromURL, isRequestedSessionIdValid, login, logout, upgrade
getAsyncContext, getAttribute, getAttributeNames, getCharacterEncoding, getContentLength, getContentLengthLong, getContentType, getDispatcherType, getInputStream, getLocalAddr, getLocalName, getLocalPort, 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, toString, wait, wait, wait
getAsyncContext, getAttribute, getAttributeNames, getCharacterEncoding, getContentLength, getContentLengthLong, getContentType, getDispatcherType, getInputStream, getLocalAddr, getLocalName, getLocalPort, getProtocol, getReader, getRealPath, getRemoteAddr, getRemoteHost, getRemotePort, getRequestDispatcher, getScheme, getServerName, getServerPort, getServletContext, isAsyncStarted, isAsyncSupported, isSecure, removeAttribute, setAttribute, setCharacterEncoding, startAsync, startAsync
protected static final org.apache.commons.logging.Log logger
protected static final java.util.TimeZone GMT_ZONE
protected static java.util.Locale defaultLocale
protected SavedRequest savedRequest
protected java.text.SimpleDateFormat[] formats
public SavedRequestAwareWrapper(javax.servlet.http.HttpServletRequest request, PortResolver portResolver, java.lang.String rolePrefix)
public javax.servlet.http.Cookie[] getCookies()
getCookies
in interface javax.servlet.http.HttpServletRequest
getCookies
in class javax.servlet.http.HttpServletRequestWrapper
public long getDateHeader(java.lang.String name)
getDateHeader
in interface javax.servlet.http.HttpServletRequest
getDateHeader
in class javax.servlet.http.HttpServletRequestWrapper
public java.lang.String getHeader(java.lang.String name)
getHeader
in interface javax.servlet.http.HttpServletRequest
getHeader
in class javax.servlet.http.HttpServletRequestWrapper
public java.util.Enumeration getHeaderNames()
getHeaderNames
in interface javax.servlet.http.HttpServletRequest
getHeaderNames
in class javax.servlet.http.HttpServletRequestWrapper
public java.util.Enumeration getHeaders(java.lang.String name)
getHeaders
in interface javax.servlet.http.HttpServletRequest
getHeaders
in class javax.servlet.http.HttpServletRequestWrapper
public int getIntHeader(java.lang.String name)
getIntHeader
in interface javax.servlet.http.HttpServletRequest
getIntHeader
in class javax.servlet.http.HttpServletRequestWrapper
public java.util.Locale getLocale()
getLocale
in interface javax.servlet.ServletRequest
getLocale
in class javax.servlet.ServletRequestWrapper
public java.util.Enumeration getLocales()
getLocales
in interface javax.servlet.ServletRequest
getLocales
in class javax.servlet.ServletRequestWrapper
public java.lang.String getMethod()
getMethod
in interface javax.servlet.http.HttpServletRequest
getMethod
in class javax.servlet.http.HttpServletRequestWrapper
public java.lang.String getParameter(java.lang.String name)
If the value from the wrapped request is null, an attempt will be made to retrieve the parameter from the SavedRequest, if available..
getParameter
in interface javax.servlet.ServletRequest
getParameter
in class javax.servlet.ServletRequestWrapper
public java.util.Map getParameterMap()
getParameterMap
in interface javax.servlet.ServletRequest
getParameterMap
in class javax.servlet.ServletRequestWrapper
public java.util.Enumeration getParameterNames()
getParameterNames
in interface javax.servlet.ServletRequest
getParameterNames
in class javax.servlet.ServletRequestWrapper
public java.lang.String[] getParameterValues(java.lang.String name)
getParameterValues
in interface javax.servlet.ServletRequest
getParameterValues
in class javax.servlet.ServletRequestWrapper