FilterRegistrationBean
A 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 onStartup. Registrations can be associated with URL patterns and/or servlets (either by name or through 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.
Author
Phillip Webb
Since
1.4.0
Parameters
<T>
the type of Filter to register
See also
Constructors
Link copied to clipboard
constructor()
Create a new FilterRegistrationBean instance.
Create a new FilterRegistrationBean instance to be registered with the specified ServletRegistrationBeans.
Functions
Link copied to clipboard
Add a single init-parameter, replacing any existing parameter with the same name.
Link copied to clipboard
Add servlet names for the filter.
Link copied to clipboard
open fun addServletRegistrationBeans(servletRegistrationBeans: Array<ServletRegistrationBean<out Any>>)
Add ServletRegistrationBeans for the filter.
Link copied to clipboard
Add URL patterns, as defined in the Servlet specification, that the filter will be registered against.
Link copied to clipboard
Determines the dispatcher types for which the filter should be registered.
Link copied to clipboard
Returns the filter name that will be registered.
Link copied to clipboard
Return a mutable collection of servlet names that the filter will be registered against.
Link copied to clipboard
Return a mutable collection of the ServletRegistrationBean that the filter will be registered against.
Link copied to clipboard
Return a mutable collection of URL patterns, as defined in the Servlet specification, that the filter will be registered against.
Link copied to clipboard
Returns if asynchronous operations are supported for this registration.
Link copied to clipboard
Return if filter mappings should be matched after any declared Filter mappings of the ServletContext.
Link copied to clipboard
Sets if asynchronous operations are supported for this registration.
Link copied to clipboard
Sets the dispatcher types that should be used with the registration.
Convenience method to set dispatcher types using the specified elements.
Link copied to clipboard
Flag to indicate that the registration is enabled.
Link copied to clipboard
Sets whether registration failures should be ignored.
Link copied to clipboard
Set if the filter mappings should be matched after any declared filter mappings of the ServletContext.
Link copied to clipboard
Set servlet names that the filter will be registered against.
Link copied to clipboard
open fun setServletRegistrationBeans(servletRegistrationBeans: Collection<out ServletRegistrationBean<out Any>>)
Set ServletRegistrationBeans that the filter will be registered against.
Link copied to clipboard
Set the URL patterns that the filter will be registered against.