public class RequestContextListener extends java.lang.Object implements ServletRequestListener
LocaleContextHolder
and
RequestContextHolder
. To be registered as listener in web.xml
.
Alternatively, Spring's RequestContextFilter
and Spring's DispatcherServlet
also expose
the same request context to the current thread. In contrast to this listener,
advanced options are available there (e.g. "threadContextInheritable").
This listener is mainly for use with third-party servlets, e.g. the JSF FacesServlet. Within Spring's own web support, DispatcherServlet's processing is perfectly sufficient.
ServletRequestListener
,
LocaleContextHolder
,
RequestContextHolder
,
RequestContextFilter
,
DispatcherServlet
Constructor and Description |
---|
RequestContextListener() |
Modifier and Type | Method and Description |
---|---|
void |
requestDestroyed(ServletRequestEvent requestEvent)
Receives notification that a ServletRequest is about to go out
of scope of the web application.
|
void |
requestInitialized(ServletRequestEvent requestEvent)
Receives notification that a ServletRequest is about to come
into scope of the web application.
|
public void requestInitialized(ServletRequestEvent requestEvent)
javax.servlet.ServletRequestListener
requestInitialized
in interface ServletRequestListener
requestEvent
- the ServletRequestEvent containing the ServletRequest
and the ServletContext representing the web applicationpublic void requestDestroyed(ServletRequestEvent requestEvent)
javax.servlet.ServletRequestListener
requestDestroyed
in interface ServletRequestListener
requestEvent
- the ServletRequestEvent containing the ServletRequest
and the ServletContext representing the web application