Annotation Interface FilterRegistration
Registers a
Filter in a Servlet 3.0+ container. Can be used as an
annotation-based alternative to FilterRegistrationBean.- Since:
- 3.5.0
- See Also:
-
Optional Element Summary
Optional ElementsModifier and TypeOptional ElementDescriptionbooleanWhether asynchronous operations are supported for this registration.jakarta.servlet.DispatcherType[]Dispatcher types that should be used with the registration.booleanWhether this registration is enabled.booleanWhether registration failures should be ignored.jakarta.servlet.annotation.WebInitParam[]Init parameters to be used with the filter.booleanWhether the filter mappings should be matched after any declared Filter mappings of the ServletContext.Name of this registration.intOrder of the registration bean.Class<?>[]Servlet classes that the filter will be registered against.String[]Servlet names that the filter will be registered against.String[]URL patterns, as defined in the Servlet specification, that the filter will be registered against.
-
Element Details
-
enabled
boolean enabledWhether this registration is enabled.- Returns:
- whether this registration is enabled
- Default:
- true
-
order
@AliasFor(annotation=org.springframework.core.annotation.Order.class, attribute="value") int orderOrder of the registration bean.- Returns:
- the order of the registration bean
- Default:
- 2147483647
-
name
String nameName of this registration. If not specified the bean name will be used.- Returns:
- the name
- Default:
- ""
-
asyncSupported
boolean asyncSupportedWhether asynchronous operations are supported for this registration.- Returns:
- whether asynchronous operations are supported
- Default:
- true
-
dispatcherTypes
jakarta.servlet.DispatcherType[] dispatcherTypesDispatcher types that should be used with the registration.- Returns:
- the dispatcher types
- Default:
- {}
-
ignoreRegistrationFailure
boolean ignoreRegistrationFailureWhether registration failures should be ignored. If set to true, a failure will be logged. If set to false, anIllegalStateExceptionwill be thrown.- Returns:
- whether registration failures should be ignored
- Default:
- false
-
initParameters
jakarta.servlet.annotation.WebInitParam[] initParametersInit parameters to be used with the filter.- Returns:
- the init parameters
- Default:
- {}
-
matchAfter
boolean matchAfterWhether the filter mappings should be matched after any declared Filter mappings of the ServletContext.- Returns:
- whether the filter mappings should be matched after any declared Filter mappings of the ServletContext
- Default:
- false
-
servletNames
String[] servletNamesServlet names that the filter will be registered against.- Returns:
- the servlet names
- Default:
- {}
-
servletClasses
Class<?>[] servletClassesServlet classes that the filter will be registered against.- Returns:
- the servlet classes
- Default:
- {}
-
urlPatterns
String[] urlPatternsURL patterns, as defined in the Servlet specification, that the filter will be registered against.- Returns:
- the url patterns
- Default:
- {}
-