Annotation Interface WebFilter
The annotation used to declare a Servlet
This annotation will be processed by the container during deployment, the Filter class in which it is found will be created as per the configuration and applied to the URL patterns,
If the name attribute is not defined, the fully qualified name of the class is used.
At least one URL pattern MUST be declared in either the
The
The annotated class MUST implement
Filter. This annotation will be processed by the container during deployment, the Filter class in which it is found will be created as per the configuration and applied to the URL patterns,
Servlets and
DispatcherTypes.If the name attribute is not defined, the fully qualified name of the class is used.
At least one URL pattern MUST be declared in either the
value or urlPattern attribute of the
annotation, but not both.The
value attribute is recommended for use when the URL pattern is the only attribute being set, otherwise
the urlPattern attribute should be used.The annotated class MUST implement
Filter. E.g. @WebFilter("/path/*")public class AnExampleFilter implements Filter { ... - Since:
- Servlet 3.0 (Section 8.1.2)
-
Optional Element Summary
Optional ElementsModifier and TypeOptional ElementDescriptionbooleanDeclares whether asynchronous operation is supported by this Filter.Provides a description of the Filter.Declares the dispatcher types to which this Filter applies.Provides a display name for the Filter.Declares the name of the Filter.Declares initialization parameters for the Filter.Provides a large icon for the Filter.String[]Declares the servlet names to which this Filter applies.Provides a small icon for the Filter.String[]Declares the URL patterns to which this Filter applies.String[]A convenience method, to allow extremely simple annotation of a class.
-
Element Details
-
description
String descriptionProvides a description of the Filter.- Returns:
- description of the Filter, if present
- Default:
""
-
displayName
String displayNameProvides a display name for the Filter.- Returns:
- display name of the Filter, if present
- Default:
""
-
initParams
WebInitParam[] initParamsDeclares initialization parameters for the Filter.- Returns:
- array of initialization params for this Filter
- Default:
{}
-
filterName
String filterNameDeclares the name of the Filter.- Returns:
- name of the Filter, if present
- Default:
""
-
smallIcon
String smallIconProvides a small icon for the Filter.- Returns:
- small icon for this Filter, if present
- Default:
""
-
largeIcon
String largeIconProvides a large icon for the Filter.- Returns:
- the large icon for this Filter, if present
- Default:
""
-
servletNames
String[] servletNamesDeclares the servlet names to which this Filter applies.- Returns:
- array of Servlet names to which this Filter applies
- Default:
{}
-
value
String[] valueA convenience method, to allow extremely simple annotation of a class.- Returns:
- array of URL patterns
- See Also:
- Default:
{}
-
urlPatterns
String[] urlPatternsDeclares the URL patterns to which this Filter applies.- Returns:
- array of URL patterns to which this Filter applies
- Default:
{}
-
dispatcherTypes
DispatcherType[] dispatcherTypesDeclares the dispatcher types to which this Filter applies.- Returns:
- array of DispatcherTypes to which this filter applies
- Default:
{REQUEST}
-
asyncSupported
boolean asyncSupportedDeclares whether asynchronous operation is supported by this Filter.- Returns:
trueif asynchronous operation is supported,falseotherwise
- Default:
false
-