Class RequestContextListener
java.lang.Object
org.springframework.web.context.request.RequestContextListener
- All Implemented Interfaces:
jakarta.servlet.ServletRequestListener, EventListener
public class RequestContextListener
extends Object
implements jakarta.servlet.ServletRequestListener
Servlet listener that exposes the request to the current thread,
through both
LocaleContextHolder and
RequestContextHolder. To be registered as listener in web.xml.
Alternatively, Spring's RequestContextFilter
and Spring's
also expose
the same request context to the current thread. In contrast to this listener,
advanced options are available there (for example, "threadContextInheritable").
invalid reference
org.springframework.web.servlet.DispatcherServlet
This listener is mainly for use with third-party servlets, for example, the JSF FacesServlet. Within Spring's own web support, DispatcherServlet's processing is perfectly sufficient.
- Since:
- 2.0
- Author:
- Juergen Hoeller
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidrequestDestroyed(jakarta.servlet.ServletRequestEvent requestEvent) voidrequestInitialized(jakarta.servlet.ServletRequestEvent requestEvent)
-
Constructor Details
-
RequestContextListener
public RequestContextListener()
-
-
Method Details
-
requestInitialized
public void requestInitialized(jakarta.servlet.ServletRequestEvent requestEvent) - Specified by:
requestInitializedin interfacejakarta.servlet.ServletRequestListener
-
requestDestroyed
public void requestDestroyed(jakarta.servlet.ServletRequestEvent requestEvent) - Specified by:
requestDestroyedin interfacejakarta.servlet.ServletRequestListener
-