org.springframework.web.filter
Class RequestContextFilter
java.lang.Object
org.springframework.web.filter.GenericFilterBean
org.springframework.web.filter.OncePerRequestFilter
org.springframework.web.filter.RequestContextFilter
- All Implemented Interfaces:
- Filter, BeanNameAware, DisposableBean, InitializingBean, ServletContextAware
public class RequestContextFilter
- extends OncePerRequestFilter
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.
- Since:
- 2.0
- Author:
- Juergen Hoeller, Rod Johnson
- See Also:
LocaleContextHolder
,
RequestContextHolder
,
RequestContextListener
,
DispatcherServlet
Methods inherited from class org.springframework.web.filter.GenericFilterBean |
addRequiredProperty, afterPropertiesSet, destroy, getFilterConfig, getFilterName, getServletContext, init, initBeanWrapper, initFilterBean, setBeanName, setFilterConfig, setServletContext |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
RequestContextFilter
public RequestContextFilter()
doFilterInternal
protected void doFilterInternal(HttpServletRequest request,
HttpServletResponse response,
FilterChain filterChain)
throws ServletException,
IOException
- Description copied from class:
OncePerRequestFilter
- 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.
- Specified by:
doFilterInternal
in class OncePerRequestFilter
- Throws:
ServletException
IOException
Copyright © 2002-2007 The Spring Framework.