java.lang.Objectorg.springframework.web.filter.GenericFilterBean
All Implemented Interfaces:
Filter, DisposableBean, BeanNameAware, InitializingBean, ServletContextAware
Direct Known Subclasses:
Log4jNestedDiagnosticContextFilter, ServletContextRequestLoggingFilter, DelegatingFilterProxy, OncePerRequestFilter, MultipartFilter, RequestContextFilter, OpenSessionInViewFilter, OpenPersistenceManagerInViewFilter, CommonsRequestLoggingFilter, CharacterEncodingFilter, OpenEntityManagerInViewFilter, OpenSessionInViewFilter, AbstractRequestLoggingFilter
init-param entries within the
filter tag in web.xml) as bean properties.
A handy superclass for any type of filter. Type conversion of config parameters is automatic, with the corresponding setter method getting invoked with the converted value. It is also possible for subclasses to specify required properties. Parameters without matching bean property setter will simply be ignored.
This filter leaves actual filtering to subclasses, which have to implement the javax.servlet.Filter#doFilter method.
This generic filter base class has no dependency on the Spring org.springframework.context.ApplicationContext concept. Filters usually don't load their own context but rather access service beans from the Spring root application context, accessible via the filter's ServletContext (see org.springframework.web.context.support.WebApplicationContextUtils ).
Juergen - Hoeller06.12.2003 - | Field Summary | ||
|---|---|---|
| protected final Log | logger | Logger available to subclasses |
| Method from org.springframework.web.filter.GenericFilterBean Summary: |
|---|
| addRequiredProperty, afterPropertiesSet, destroy, getFilterConfig, getFilterName, getServletContext, init, initBeanWrapper, initFilterBean, setBeanName, setServletContext |
| Methods from java.lang.Object: |
|---|
| equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method from org.springframework.web.filter.GenericFilterBean Detail: |
|---|
This method is only relevant in case of traditional initialization driven by a FilterConfig instance. |
initFilterBean() method that might
contain custom initialization of a subclass.
Only relevant in case of initialization as bean, where the
standard |
Note: This method will be called from standard filter destruction as well as filter bean destruction in a Spring application context. This default implementation is empty. |
getServletConfig().
Public to resemble the |
getServletName().
Takes the FilterConfig's filter name by default. If initialized as bean in a Spring application context, it falls back to the bean name as defined in the bean factory. |
getServletContext().
Takes the FilterConfig's ServletContext by default. If initialized as bean in a Spring application context, it falls back to the ServletContext that the bean factory runs in. |
|
This default implementation is empty. |
Note: This method will be called from standard filter initialization as well as filter bean initialization in a Spring application context. Filter name and ServletContext will be available in both cases. This default implementation is empty. |
Only relevant in case of initialization as bean, to have a name as fallback to the filter name usually provided by a FilterConfig instance. |
Only relevant in case of initialization as bean, to have a ServletContext as fallback to the context usually provided by a FilterConfig instance. |