Top Description Inners Methods
jakarta.servlet

public Interface FilterRegistration

extends Registration
Known Direct Subinterfaces
jakarta.servlet.FilterRegistration.Dynamic
Imports
java.util.Collection, .EnumSet

Interface through which a Filter may be further configured.
Since
Servlet 3.0

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static interface
FilterRegistration.Dynamic

Interface through which a Filter registered via one of the addFilter methods on ServletContext may be further configured.

Method Summary

Modifier and TypeMethod and Description
public void
addMappingForServletNames(EnumSet<DispatcherType>
The dispatch types to which this filter should apply
dispatcherTypes
,
boolean
Should this filter be applied after any mappings defined in the deployment descriptor (true) or before?
isMatchAfter
,
String...
Requests mapped to these servlets will be processed by this filter
servletNames
)

Add a mapping for this filter to one or more named Servlets.

public void
addMappingForUrlPatterns(EnumSet<DispatcherType>
The dispatch types to which this filter should apply
dispatcherTypes
,
boolean
Should this filter be applied after any mappings defined in the deployment descriptor (true) or before?
isMatchAfter
,
String...
The URL patterns to which this filter should be applied
urlPatterns
)

Add a mapping for this filter to one or more URL patterns.

public Collection<String>

Returns:

a Collection of the Servlet name mappings
getServletNameMappings
()

Gets the currently available servlet name mappings of the Filter represented by this FilterRegistration.

public Collection<String>

Returns:

a Collection of the URL pattern mappings
getUrlPatternMappings
()

Gets the currently available URL pattern mappings of the Filter represented by this FilterRegistration.

Inherited from jakarta.servlet.Registration:
getClassNamegetInitParametergetInitParametersgetNamesetInitParametersetInitParameters

Method Detail

addMappingForServletNamesback to summary
public void addMappingForServletNames(EnumSet<DispatcherType> dispatcherTypes, boolean isMatchAfter, String... servletNames)

Add a mapping for this filter to one or more named Servlets.

Parameters
dispatcherTypes:EnumSet<DispatcherType>

The dispatch types to which this filter should apply

isMatchAfter:boolean

Should this filter be applied after any mappings defined in the deployment descriptor (true) or before?

servletNames:String[]

Requests mapped to these servlets will be processed by this filter

Exceptions
IllegalArgumentException:
if the list of servlet names is empty or null
IllegalStateException:
if the associated ServletContext has already been initialised
addMappingForUrlPatternsback to summary
public void addMappingForUrlPatterns(EnumSet<DispatcherType> dispatcherTypes, boolean isMatchAfter, String... urlPatterns)

Add a mapping for this filter to one or more URL patterns.

Parameters
dispatcherTypes:EnumSet<DispatcherType>

The dispatch types to which this filter should apply

isMatchAfter:boolean

Should this filter be applied after any mappings defined in the deployment descriptor (true) or before?

urlPatterns:String[]

The URL patterns to which this filter should be applied

Exceptions
IllegalArgumentException:
if the list of URL patterns is empty or null
IllegalStateException:
if the associated ServletContext has already been initialised
getServletNameMappingsback to summary
public Collection<String> getServletNameMappings()

Gets the currently available servlet name mappings of the Filter represented by this FilterRegistration.

Returns:Collection<String>

a Collection of the Servlet name mappings

getUrlPatternMappingsback to summary
public Collection<String> getUrlPatternMappings()

Gets the currently available URL pattern mappings of the Filter represented by this FilterRegistration.

Returns:Collection<String>

a Collection of the URL pattern mappings

jakarta.servlet back to summary

public Interface FilterRegistration.Dynamic

extends FilterRegistration, Dynamic
Known Direct Implementers
org.apache.catalina.core.ApplicationFilterRegistration

Interface through which a Filter registered via one of the addFilter methods on ServletContext may be further configured.

Method Summary

Inherited from jakarta.servlet.FilterRegistration:
addMappingForServletNamesaddMappingForUrlPatternsgetServletNameMappingsgetUrlPatternMappings
Inherited from jakarta.servlet.Registration.Dynamic:
setAsyncSupported