public class FilterRegistrationBean extends AbstractFilterRegistrationBean
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
AbstractFilterRegistrationBean.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| Modifier and Type | Field and Description |
|---|---|
static int |
REQUEST_WRAPPER_FILTER_MAX_ORDER
Filters that wrap the servlet request should be ordered less than or equal to this.
|
| Constructor and Description |
|---|
FilterRegistrationBean()
Create a new
FilterRegistrationBean instance. |
FilterRegistrationBean(javax.servlet.Filter filter,
ServletRegistrationBean... servletRegistrationBeans)
Create a new
FilterRegistrationBean instance to be registered with the
specified ServletRegistrationBeans. |
| Modifier and Type | Method and Description |
|---|---|
javax.servlet.Filter |
getFilter()
Return the
Filter to be registered. |
void |
setFilter(javax.servlet.Filter filter)
Set the filter to be registered.
|
addServletNames, addServletRegistrationBeans, addUrlPatterns, configure, getServletNames, getServletRegistrationBeans, getUrlPatterns, isMatchAfter, onStartup, setDispatcherTypes, setDispatcherTypes, setMatchAfter, setServletNames, setServletRegistrationBeans, setUrlPatternsaddInitParameter, configure, getInitParameters, getOrDeduceName, getOrder, isAsyncSupported, isEnabled, setAsyncSupported, setEnabled, setInitParameters, setName, setOrderpublic static final int REQUEST_WRAPPER_FILTER_MAX_ORDER
public FilterRegistrationBean()
FilterRegistrationBean instance.public FilterRegistrationBean(javax.servlet.Filter filter,
ServletRegistrationBean... servletRegistrationBeans)
FilterRegistrationBean instance to be registered with the
specified ServletRegistrationBeans.filter - the filter to registerservletRegistrationBeans - associate ServletRegistrationBeanspublic javax.servlet.Filter getFilter()
AbstractFilterRegistrationBeanFilter to be registered.getFilter in class AbstractFilterRegistrationBeanpublic void setFilter(javax.servlet.Filter filter)
filter - the filterCopyright © 2019 Pivotal Software, Inc.. All rights reserved.