public class FilterRegistration extends Registration implements javax.servlet.FilterRegistration.Dynamic
Filter registered with the WebappContext.| Modifier and Type | Field and Description |
|---|---|
protected javax.servlet.Filter |
filter |
protected Class<? extends javax.servlet.Filter> |
filterClass |
protected boolean |
isAsyncSupported |
className, ctx, initParameters, name| Modifier | Constructor and Description |
|---|---|
protected |
FilterRegistration(WebappContext ctx,
String name,
Class<? extends javax.servlet.Filter> filter)
Creates a new FilterRegistration associated with the specified
WebappContext. |
protected |
FilterRegistration(WebappContext ctx,
String name,
javax.servlet.Filter filter)
Creates a new FilterRegistration associated with the specified
WebappContext. |
protected |
FilterRegistration(WebappContext ctx,
String name,
String filterClassName)
Creates a new FilterRegistration associated with the specified
WebappContext. |
| Modifier and Type | Method and Description |
|---|---|
void |
addMappingForServletNames(EnumSet<javax.servlet.DispatcherType> dispatcherTypes,
boolean isMatchAfter,
String... servletNames) |
void |
addMappingForServletNames(EnumSet<javax.servlet.DispatcherType> dispatcherTypes,
String... servletNames)
Adds a filter mapping with the given servlet names and dispatcher
types for the Filter represented by this FilterRegistration.
|
void |
addMappingForUrlPatterns(EnumSet<javax.servlet.DispatcherType> dispatcherTypes,
boolean isMatchAfter,
String... urlPatterns) |
void |
addMappingForUrlPatterns(EnumSet<javax.servlet.DispatcherType> dispatcherTypes,
String... urlPatterns)
Adds a filter mapping with the given url patterns and dispatcher
types for the Filter represented by this FilterRegistration.
|
Collection<String> |
getServletNameMappings()
Gets the currently available servlet name mappings
of the Filter represented by this
FilterRegistration. |
Collection<String> |
getUrlPatternMappings()
Gets the currently available URL pattern mappings of the Filter
represented by this
FilterRegistration. |
void |
setAsyncSupported(boolean isAsyncSupported) |
equals, getClassName, getInitParameter, getInitParameters, getName, hashCode, setInitParameter, setInitParametersprotected Class<? extends javax.servlet.Filter> filterClass
protected javax.servlet.Filter filter
protected boolean isAsyncSupported
protected FilterRegistration(WebappContext ctx, String name, String filterClassName)
WebappContext.ctx - the owning WebappContext.name - the name of the Filter.filterClassName - the fully qualified class name of the Filter
implementation.protected FilterRegistration(WebappContext ctx, String name, Class<? extends javax.servlet.Filter> filter)
WebappContext.ctx - the owning WebappContext.name - name the name of the Filter.filter - the class of the Filter implementationprotected FilterRegistration(WebappContext ctx, String name, javax.servlet.Filter filter)
WebappContext.ctx - the owning WebappContext.name - name the name of the Filter.filter - the Filter instance.public void addMappingForServletNames(EnumSet<javax.servlet.DispatcherType> dispatcherTypes, String... servletNames)
Filter mappings are matched in the order in which they were added.
If this method is called multiple times, each successive call adds to the effects of the former.
dispatcherTypes - the dispatcher types of the filter mapping,
or null if the default DispatcherType.REQUEST is to be usedservletNames - the servlet names of the filter mappingIllegalArgumentException - if servletNames is null or
emptyIllegalStateException - if the ServletContext from which this
FilterRegistration was obtained has already been initializedpublic void addMappingForServletNames(EnumSet<javax.servlet.DispatcherType> dispatcherTypes, boolean isMatchAfter, String... servletNames)
addMappingForServletNames in interface javax.servlet.FilterRegistrationpublic Collection<String> getServletNameMappings()
FilterRegistration.
If permitted, any changes to the returned Collection must not
affect this FilterRegistration.
getServletNameMappings in interface javax.servlet.FilterRegistrationCollection of the currently
available servlet name mappings of the Filter represented by this
FilterRegistrationpublic void addMappingForUrlPatterns(EnumSet<javax.servlet.DispatcherType> dispatcherTypes, String... urlPatterns)
Filter mappings are matched in the order in which they were added.
If this method is called multiple times, each successive call adds to the effects of the former.
dispatcherTypes - the dispatcher types of the filter mapping,
or null if the default DispatcherType.REQUEST is to be usedurlPatterns - the url patterns of the filter mappingIllegalArgumentException - if urlPatterns is null or
emptyIllegalStateException - if the ServletContext from which this
FilterRegistration was obtained has already been initializedpublic void addMappingForUrlPatterns(EnumSet<javax.servlet.DispatcherType> dispatcherTypes, boolean isMatchAfter, String... urlPatterns)
addMappingForUrlPatterns in interface javax.servlet.FilterRegistrationpublic Collection<String> getUrlPatternMappings()
FilterRegistration.
If permitted, any changes to the returned Collection must not
affect this FilterRegistration.
getUrlPatternMappings in interface javax.servlet.FilterRegistrationCollection of the currently
available URL pattern mappings of the Filter represented by this
FilterRegistrationpublic void setAsyncSupported(boolean isAsyncSupported)
setAsyncSupported in interface javax.servlet.Registration.DynamicCopyright © 2019 Oracle Corporation. All Rights Reserved.