Top Fields Constructors Methods
org.eclipse.jetty.ee10.servlet

public Class FilterMapping

extends Object
implements Dumpable
Class Inheritance
All Implemented Interfaces
org.eclipse.jetty.util.component.Dumpable
Annotations
@ManagedObject:Filter Mappings
Imports
java.io.IOException, java.util.Arrays, .EnumSet, .Objects, java.util.stream.Collectors, jakarta.servlet.DispatcherType, org.eclipse.jetty.http.pathmap.ServletPathSpec, org.eclipse.jetty.util.TypeUtil, org.eclipse.jetty.util.annotation.ManagedAttribute, .ManagedObject, org.eclipse.jetty.util.component.Dumpable

Field Summary

Modifier and TypeField and Description
private int
private String
private FilterHolder
private String[]
private String[]
public static final int
public static final int
public static final int
DEFAULT

Dispatch types

public static final int
public static final int
public static final int
public static final int

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
pack-priv boolean

Returns:

True if this filter applies
appliesTo
(String
The path to check or null to just check type
path
,
int
The type of request: __REQUEST,__FORWARD,__INCLUDE, __ASYNC or __ERROR.
type
)

Check if this filter applies to a path.

pack-priv boolean

Returns:

true if this filter applies
appliesTo
(int
The type of request: REQUEST, FORWARD, INCLUDE or ERROR.
type
)

Check if this filter applies to a particular dispatch type.

public boolean
public static DispatcherType

Returns:

the dispatcher type
dispatch
(String
the type name
type
)

Dispatch type from name

public static int

Returns:

the type constant (REQUEST, ASYNC, FORWARD, INCLUDE, or ERROR)
dispatch
(DispatcherType
the dispatcher type
type
)

Dispatch type from name

public static DispatcherType

Returns:

the type constant (REQUEST, ASYNC, FORWARD, INCLUDE, or ERROR)
dispatch
(int
the dispatcher type
type
)

Dispatch type from name

public void
dump(Appendable
The appendable to dump to
out
,
String
The indent to apply after any new lines.
indent
)

Implements org.eclipse.jetty.util.component.Dumpable.dump.

Dump this object (and children) into an Appendable using the provided indent after any new lines.

public String
public EnumSet<DispatcherType>
pack-priv FilterHolder
getFilterHolder()

Returns: Returns the holder.

public String
getFilterName()

Returns: Returns the filterName.

public String[]
getPathSpecs()

Returns: Returns the pathSpec.

public String[]
getServletNames()

Returns: Returns the servletName.

public boolean
public void
public void
setDispatches(int
The dispatches to set.
dispatches
)

pack-priv void
setFilterHolder(FilterHolder
The holder to set.
holder
)

public void
setFilterName(String
The filterName to set.
filterName
)

public void
setPathSpec(String
The pathSpec to set.
pathSpec
)

public void
setPathSpecs(String[]
The Path specifications to which this filter should be mapped.
pathSpecs
)

public void
setServletName(String
Maps the named filter to a single servlet
servletName
)

public void
setServletNames(String[]
Maps the named filter to multiple servlets
servletNames
)

public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait

Field Detail

_dispatchesback to summary
private int _dispatches
_filterNameback to summary
private String _filterName
_holderback to summary
private FilterHolder _holder
_pathSpecsback to summary
private String[] _pathSpecs
_servletNamesback to summary
private String[] _servletNames
ALLback to summary
public static final int ALL
ASYNCback to summary
public static final int ASYNC
DEFAULTback to summary
public static final int DEFAULT

Dispatch types

ERRORback to summary
public static final int ERROR
FORWARDback to summary
public static final int FORWARD
INCLUDEback to summary
public static final int INCLUDE
REQUESTback to summary
public static final int REQUEST

Constructor Detail

FilterMappingback to summary
public FilterMapping()

Method Detail

appliesToback to summary
pack-priv boolean appliesTo(String path, int type)

Check if this filter applies to a path.

Parameters
path:String

The path to check or null to just check type

type:int

The type of request: __REQUEST,__FORWARD,__INCLUDE, __ASYNC or __ERROR.

Returns:boolean

True if this filter applies

appliesToback to summary
pack-priv boolean appliesTo(int type)

Check if this filter applies to a particular dispatch type.

Parameters
type:int

The type of request: REQUEST, FORWARD, INCLUDE or ERROR.

Returns:boolean

true if this filter applies

appliesToback to summary
public boolean appliesTo(DispatcherType t)
dispatchback to summary
public static DispatcherType dispatch(String type)

Dispatch type from name

Parameters
type:String

the type name

Returns:DispatcherType

the dispatcher type

dispatchback to summary
public static int dispatch(DispatcherType type)

Dispatch type from name

Parameters
type:DispatcherType

the dispatcher type

Returns:int

the type constant (REQUEST, ASYNC, FORWARD, INCLUDE, or ERROR)

dispatchback to summary
public static DispatcherType dispatch(int type)

Dispatch type from name

Parameters
type:int

the dispatcher type

Returns:DispatcherType

the type constant (REQUEST, ASYNC, FORWARD, INCLUDE, or ERROR)

dumpback to summary
public void dump(Appendable out, String indent) throws IOException

Implements org.eclipse.jetty.util.component.Dumpable.dump.

Doc from org.eclipse.jetty.util.component.Dumpable.dump.

Dump this object (and children) into an Appendable using the provided indent after any new lines. The indent should not be applied to the first object dumped.

Parameters
out:Appendable

The appendable to dump to

indent:String

The indent to apply after any new lines.

Annotations
@Override
Exceptions
IOException:
if unable to write to Appendable
dumpback to summary
public String dump()

Overrides default org.eclipse.jetty.util.component.Dumpable.dump.

Annotations
@Override
getDispatcherTypesback to summary
public EnumSet<DispatcherType> getDispatcherTypes()
getFilterHolderback to summary
pack-priv FilterHolder getFilterHolder()
Returns:FilterHolder

Returns the holder.

getFilterNameback to summary
public String getFilterName()
Returns:String

Returns the filterName.

Annotations
@ManagedAttribute:filter name
readonly:true
getPathSpecsback to summary
public String[] getPathSpecs()
Returns:String[]

Returns the pathSpec.

Annotations
@ManagedAttribute:url patterns
readonly:true
getServletNamesback to summary
public String[] getServletNames()
Returns:String[]

Returns the servletName.

Annotations
@ManagedAttribute:servlet names
readonly:true
isDefaultDispatchesback to summary
public boolean isDefaultDispatches()
setDispatcherTypesback to summary
public void setDispatcherTypes(EnumSet<DispatcherType> dispatcherTypes)
setDispatchesback to summary
public void setDispatches(int dispatches)
Parameters
dispatches:int

The dispatches to set.

See Also
DEFAULT, REQUEST, ERROR, FORWARD, INCLUDE
setFilterHolderback to summary
pack-priv void setFilterHolder(FilterHolder holder)
Parameters
holder:FilterHolder

The holder to set.

setFilterNameback to summary
public void setFilterName(String filterName)
Parameters
filterName:String

The filterName to set.

setPathSpecback to summary
public void setPathSpec(String pathSpec)
Parameters
pathSpec:String

The pathSpec to set.

setPathSpecsback to summary
public void setPathSpecs(String[] pathSpecs)
Parameters
pathSpecs:String[]

The Path specifications to which this filter should be mapped.

setServletNameback to summary
public void setServletName(String servletName)
Parameters
servletName:String

Maps the named filter to a single servlet

See Also
setServletNames
setServletNamesback to summary
public void setServletNames(String[] servletNames)
Parameters
servletNames:String[]

Maps the named filter to multiple servlets

See Also
setServletName
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object. Satisfying this method's contract implies a non-null result must be returned.

Returns:String

a string representation of the object

Annotations
@Override