T
- the type of Filter
to registerpublic class FilterRegistrationBean<T extends Filter> extends AbstractFilterRegistrationBean<T>
ServletContextInitializer
to register Filter
s 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 ServletRegistrationBean
s. 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
Deprecated.
since 2.1.0 in favor of
OrderedFilter.REQUEST_WRAPPER_FILTER_MAX_ORDER |
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 ServletRegistrationBean s. |
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, toString
addInitParameter, getInitParameters, getOrDeduceName, isAsyncSupported, register, setAsyncSupported, setInitParameters, setName
getOrder, isEnabled, onStartup, setEnabled, setOrder
@Deprecated public static final int REQUEST_WRAPPER_FILTER_MAX_ORDER
OrderedFilter.REQUEST_WRAPPER_FILTER_MAX_ORDER
public FilterRegistrationBean()
FilterRegistrationBean
instance.public FilterRegistrationBean(T filter, ServletRegistrationBean<?>... servletRegistrationBeans)
FilterRegistrationBean
instance to be registered with the
specified ServletRegistrationBean
s.filter
- the filter to registerservletRegistrationBeans
- associate ServletRegistrationBean
spublic T getFilter()
AbstractFilterRegistrationBean
Filter
to be registered.getFilter
in class AbstractFilterRegistrationBean<T extends Filter>
public void setFilter(T filter)
filter
- the filterCopyright © 2019 Pivotal Software, Inc.. All rights reserved.