类 RequestContextListener
- java.lang.Object
- org.springframework.web.context.request.RequestContextListener
- 所有已实现的接口:
EventListener
,ServletRequestListener
public class RequestContextListener extends Object implements ServletRequestListener
Servlet listener that exposes the request to the current thread, through bothLocaleContextHolder
andRequestContextHolder
. To be registered as listener inweb.xml
.Alternatively, Spring's
RequestContextFilter
and Spring'sDispatcherServlet
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.
- 从以下版本开始:
- 2.0
- 作者:
- Juergen Hoeller
- 另请参阅:
ServletRequestListener
,LocaleContextHolder
,RequestContextHolder
,RequestContextFilter
,DispatcherServlet
构造器概要
构造器 构造器 说明 RequestContextListener()
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 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.
构造器详细资料
RequestContextListener
public RequestContextListener()
方法详细资料
requestInitialized
public void requestInitialized(ServletRequestEvent requestEvent)
从接口复制的说明:javax.servlet.ServletRequestListener
Receives notification that a ServletRequest is about to come into scope of the web application.- 指定者:
requestInitialized
在接口中ServletRequestListener
- 参数:
requestEvent
- the ServletRequestEvent containing the ServletRequest and the ServletContext representing the web application
requestDestroyed
public void requestDestroyed(ServletRequestEvent requestEvent)
从接口复制的说明:javax.servlet.ServletRequestListener
Receives notification that a ServletRequest is about to go out of scope of the web application.- 指定者:
requestDestroyed
在接口中ServletRequestListener
- 参数:
requestEvent
- the ServletRequestEvent containing the ServletRequest and the ServletContext representing the web application