Spring Framework

org.springframework.web.context.request
Class RequestContextListener

java.lang.Object
  extended by org.springframework.web.context.request.RequestContextListener
All Implemented Interfaces:
java.util.EventListener, javax.servlet.ServletRequestListener

public class RequestContextListener
extends java.lang.Object
implements javax.servlet.ServletRequestListener

Servlet 2.4+ 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 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.

Since:
2.0
Author:
Juergen Hoeller
See Also:
ServletRequestListener, LocaleContextHolder, RequestContextHolder, RequestContextFilter, DispatcherServlet

Constructor Summary
RequestContextListener()
           
 
Method Summary
 void requestDestroyed(javax.servlet.ServletRequestEvent requestEvent)
           
 void requestInitialized(javax.servlet.ServletRequestEvent requestEvent)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RequestContextListener

public RequestContextListener()
Method Detail

requestInitialized

public void requestInitialized(javax.servlet.ServletRequestEvent requestEvent)
Specified by:
requestInitialized in interface javax.servlet.ServletRequestListener

requestDestroyed

public void requestDestroyed(javax.servlet.ServletRequestEvent requestEvent)
Specified by:
requestDestroyed in interface javax.servlet.ServletRequestListener

Spring Framework