java.lang.Object | |||
↳ | org.springframework.web.filter.GenericFilterBean | ||
↳ | org.springframework.web.filter.OncePerRequestFilter | ||
↳ | org.springframework.web.filter.RequestContextFilter |
Servlet 2.3 Filter that exposes the request to the current thread,
through both LocaleContextHolder
and
RequestContextHolder
. To be registered as filter in web.xml
.
Alternatively, Spring's RequestContextListener
and Spring's DispatcherServlet
also expose
the same request context to the current thread.
This filter 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.
[Expand]
Inherited Constants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
org.springframework.web.filter.OncePerRequestFilter
|
[Expand]
Inherited Fields | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
org.springframework.web.filter.GenericFilterBean
|
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Set whether to expose the LocaleContext and RequestAttributes as inheritable
for child threads (using an
InheritableThreadLocal ). |
Protected Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Same contract as for
doFilter , but guaranteed to be
just invoked once per request. |
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
org.springframework.web.filter.OncePerRequestFilter
| |||||||||||
From class
org.springframework.web.filter.GenericFilterBean
| |||||||||||
From class
java.lang.Object
| |||||||||||
From interface
javax.servlet.Filter
| |||||||||||
From interface
org.springframework.beans.factory.BeanNameAware
| |||||||||||
From interface
org.springframework.beans.factory.DisposableBean
| |||||||||||
From interface
org.springframework.beans.factory.InitializingBean
| |||||||||||
From interface
org.springframework.context.EnvironmentAware
| |||||||||||
From interface
org.springframework.web.context.ServletContextAware
|
Set whether to expose the LocaleContext and RequestAttributes as inheritable
for child threads (using an InheritableThreadLocal
).
Default is "false", to avoid side effects on spawned background threads. Switch this to "true" to enable inheritance for custom child threads which are spawned during request processing and only used for this request (that is, ending after their initial task, without reuse of the thread).
WARNING: Do not use inheritance for child threads if you are
accessing a thread pool which is configured to potentially add new threads
on demand (e.g. a JDK ThreadPoolExecutor
),
since this will expose the inherited context to such a pooled thread.
Same contract as for doFilter
, but guaranteed to be
just invoked once per request. Provides HttpServletRequest and
HttpServletResponse arguments instead of the default ServletRequest
and ServletResponse ones.
IOException | |
---|---|
ServletException |