public class ContextExposingHttpServletRequest extends HttpServletRequestWrapper
BASIC_AUTH, CLIENT_CERT_AUTH, DIGEST_AUTH, FORM_AUTH
Constructor and Description |
---|
ContextExposingHttpServletRequest(HttpServletRequest originalRequest,
WebApplicationContext context)
Create a new ContextExposingHttpServletRequest for the given request.
|
ContextExposingHttpServletRequest(HttpServletRequest originalRequest,
WebApplicationContext context,
java.util.Set<java.lang.String> exposedContextBeanNames)
Create a new ContextExposingHttpServletRequest for the given request.
|
Modifier and Type | Method and Description |
---|---|
java.lang.Object |
getAttribute(java.lang.String name)
The default behavior of this method is to call getAttribute(String name)
on the wrapped request object.
|
WebApplicationContext |
getWebApplicationContext()
Return the WebApplicationContext that this request runs in.
|
void |
setAttribute(java.lang.String name,
java.lang.Object value)
The default behavior of this method is to return
setAttribute(String name, Object o) on the wrapped request object.
|
authenticate, changeSessionId, getAuthType, getContextPath, getCookies, getDateHeader, getHeader, getHeaderNames, getHeaders, getHttpServletMapping, getIntHeader, getMethod, getPart, getParts, getPathInfo, getPathTranslated, getQueryString, getRemoteUser, getRequestedSessionId, getRequestURI, getRequestURL, getServletPath, getSession, getSession, getTrailerFields, getUserPrincipal, isRequestedSessionIdFromCookie, isRequestedSessionIdFromUrl, isRequestedSessionIdFromURL, isRequestedSessionIdValid, isTrailerFieldsReady, isUserInRole, login, logout, newPushBuilder, upgrade
getAsyncContext, getAttributeNames, getCharacterEncoding, getContentLength, getContentLengthLong, 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, setCharacterEncoding, setRequest, startAsync, startAsync
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getAsyncContext, getAttributeNames, getCharacterEncoding, getContentLength, getContentLengthLong, 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, setCharacterEncoding, startAsync, startAsync
public ContextExposingHttpServletRequest(HttpServletRequest originalRequest, WebApplicationContext context)
originalRequest
- the original HttpServletRequestcontext
- the WebApplicationContext that this request runs inpublic ContextExposingHttpServletRequest(HttpServletRequest originalRequest, WebApplicationContext context, @Nullable java.util.Set<java.lang.String> exposedContextBeanNames)
originalRequest
- the original HttpServletRequestcontext
- the WebApplicationContext that this request runs inexposedContextBeanNames
- the names of beans in the context which
are supposed to be exposed (if this is non-null, only the beans in this
Set are eligible for exposure as attributes)public final WebApplicationContext getWebApplicationContext()
@Nullable public java.lang.Object getAttribute(java.lang.String name)
javax.servlet.ServletRequestWrapper
getAttribute
in interface ServletRequest
getAttribute
in class ServletRequestWrapper
name
- a String
specifying the name of the attributeObject
containing the value of the attribute,
or null
if the attribute does not existpublic void setAttribute(java.lang.String name, java.lang.Object value)
javax.servlet.ServletRequestWrapper
setAttribute
in interface ServletRequest
setAttribute
in class ServletRequestWrapper
name
- a String
specifying
the name of the attributevalue
- the Object
to be stored