public class ContextExposingHttpServletRequest
extends HttpServletRequestWrapper
Modifier and Type | Field and Description |
---|---|
private java.util.Set<java.lang.String> |
explicitAttributes |
private java.util.Set<java.lang.String> |
exposedContextBeanNames |
private WebApplicationContext |
webApplicationContext |
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) |
WebApplicationContext |
getWebApplicationContext()
Return the WebApplicationContext that this request runs in.
|
void |
setAttribute(java.lang.String name,
java.lang.Object value) |
private final WebApplicationContext webApplicationContext
private final java.util.Set<java.lang.String> exposedContextBeanNames
private java.util.Set<java.lang.String> explicitAttributes
public ContextExposingHttpServletRequest(HttpServletRequest originalRequest, WebApplicationContext context)
originalRequest
- the original HttpServletRequestcontext
- the WebApplicationContext that this request runs inpublic ContextExposingHttpServletRequest(HttpServletRequest originalRequest, WebApplicationContext context, 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()
public java.lang.Object getAttribute(java.lang.String name)
public void setAttribute(java.lang.String name, java.lang.Object value)