T - the type of Filter to registerpublic class FilterRegistrationBean<T extends javax.servlet.Filter> extends AbstractFilterRegistrationBean<T>
ServletContextInitializer to register Filters in a Servlet 3.0+
container. Similar to the registration
features provided by ServletContext but with a Spring Bean friendly design.
The Filter must be specified before calling
RegistrationBean.onStartup(ServletContext). Registrations can be associated with
URL patterns and/or servlets (either by name or via a ServletRegistrationBeans). When no
URL pattern or servlets are specified the filter will be associated to '/*'. The filter
name will be deduced if not specified.
ServletContextInitializer,
ServletContext.addFilter(String, Filter),
DelegatingFilterProxyRegistrationBean| Constructor and Description |
|---|
FilterRegistrationBean()
Create a new
FilterRegistrationBean instance. |
FilterRegistrationBean(T filter,
ServletRegistrationBean<?>... servletRegistrationBeans)
Create a new
FilterRegistrationBean instance to be registered with the
specified ServletRegistrationBeans. |
| Modifier and Type | Method and Description |
|---|---|
T |
getFilter()
Return the
Filter to be registered. |
void |
setFilter(T filter)
Set the filter to be registered.
|
addRegistration, addServletNames, addServletRegistrationBeans, addUrlPatterns, configure, getDescription, getServletNames, getServletRegistrationBeans, getUrlPatterns, isMatchAfter, setDispatcherTypes, setDispatcherTypes, setMatchAfter, setServletNames, setServletRegistrationBeans, setUrlPatterns, toStringaddInitParameter, getInitParameters, getOrDeduceName, isAsyncSupported, register, setAsyncSupported, setInitParameters, setNamegetOrder, isEnabled, onStartup, setEnabled, setOrderpublic FilterRegistrationBean()
FilterRegistrationBean instance.public FilterRegistrationBean(T filter, ServletRegistrationBean<?>... servletRegistrationBeans)
FilterRegistrationBean instance to be registered with the
specified ServletRegistrationBeans.filter - the filter to registerservletRegistrationBeans - associate ServletRegistrationBeanspublic T getFilter()
AbstractFilterRegistrationBeanFilter to be registered.getFilter in class AbstractFilterRegistrationBean<T extends javax.servlet.Filter>public void setFilter(T filter)
filter - the filter