Package org.eclipse.jetty.servlet
Class FilterMapping
- java.lang.Object
-
- org.eclipse.jetty.servlet.FilterMapping
-
- All Implemented Interfaces:
Dumpable
@ManagedObject("Filter Mappings") public class FilterMapping extends java.lang.Object implements Dumpable
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.eclipse.jetty.util.component.Dumpable
Dumpable.DumpableContainer
-
-
Field Summary
Fields Modifier and Type Field Description private int
_dispatches
private java.lang.String
_filterName
private FilterHolder
_holder
private java.lang.String[]
_pathSpecs
private java.lang.String[]
_servletNames
static int
ALL
static int
ASYNC
static int
DEFAULT
Dispatch typesstatic int
ERROR
static int
FORWARD
static int
INCLUDE
static int
REQUEST
-
Constructor Summary
Constructors Constructor Description FilterMapping()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description (package private) boolean
appliesTo(int type)
Check if this filter applies to a particular dispatch type.(package private) boolean
appliesTo(java.lang.String path, int type)
Check if this filter applies to a path.boolean
appliesTo(javax.servlet.DispatcherType t)
static javax.servlet.DispatcherType
dispatch(int type)
Dispatch type from namestatic javax.servlet.DispatcherType
dispatch(java.lang.String type)
Dispatch type from namestatic int
dispatch(javax.servlet.DispatcherType type)
Dispatch type from namejava.lang.String
dump()
void
dump(java.lang.Appendable out, java.lang.String indent)
Dump this object (and children) into an Appendable using the provided indent after any new lines.java.util.EnumSet<javax.servlet.DispatcherType>
getDispatcherTypes()
(package private) FilterHolder
getFilterHolder()
java.lang.String
getFilterName()
java.lang.String[]
getPathSpecs()
java.lang.String[]
getServletNames()
boolean
isDefaultDispatches()
void
setDispatcherTypes(java.util.EnumSet<javax.servlet.DispatcherType> dispatcherTypes)
void
setDispatches(int dispatches)
(package private) void
setFilterHolder(FilterHolder holder)
void
setFilterName(java.lang.String filterName)
void
setPathSpec(java.lang.String pathSpec)
void
setPathSpecs(java.lang.String[] pathSpecs)
void
setServletName(java.lang.String servletName)
void
setServletNames(java.lang.String[] servletNames)
java.lang.String
toString()
-
-
-
Field Detail
-
DEFAULT
public static final int DEFAULT
Dispatch types- See Also:
- Constant Field Values
-
REQUEST
public static final int REQUEST
- See Also:
- Constant Field Values
-
FORWARD
public static final int FORWARD
- See Also:
- Constant Field Values
-
INCLUDE
public static final int INCLUDE
- See Also:
- Constant Field Values
-
ERROR
public static final int ERROR
- See Also:
- Constant Field Values
-
ASYNC
public static final int ASYNC
- See Also:
- Constant Field Values
-
ALL
public static final int ALL
- See Also:
- Constant Field Values
-
_dispatches
private int _dispatches
-
_filterName
private java.lang.String _filterName
-
_holder
private transient FilterHolder _holder
-
_pathSpecs
private java.lang.String[] _pathSpecs
-
_servletNames
private java.lang.String[] _servletNames
-
-
Method Detail
-
dispatch
public static javax.servlet.DispatcherType dispatch(java.lang.String type)
Dispatch type from name- Parameters:
type
- the type name- Returns:
- the dispatcher type
-
dispatch
public static int dispatch(javax.servlet.DispatcherType type)
Dispatch type from name
-
dispatch
public static javax.servlet.DispatcherType dispatch(int type)
Dispatch type from name
-
appliesTo
boolean appliesTo(java.lang.String path, int type)
Check if this filter applies to a path.- Parameters:
path
- The path to check or null to just check typetype
- The type of request: __REQUEST,__FORWARD,__INCLUDE, __ASYNC or __ERROR.- Returns:
- True if this filter applies
-
appliesTo
boolean appliesTo(int type)
Check if this filter applies to a particular dispatch type.
-
appliesTo
public boolean appliesTo(javax.servlet.DispatcherType t)
-
isDefaultDispatches
public boolean isDefaultDispatches()
-
getFilterName
@ManagedAttribute(value="filter name", readonly=true) public java.lang.String getFilterName()
- Returns:
- Returns the filterName.
-
getFilterHolder
FilterHolder getFilterHolder()
- Returns:
- Returns the holder.
-
getPathSpecs
@ManagedAttribute(value="url patterns", readonly=true) public java.lang.String[] getPathSpecs()
- Returns:
- Returns the pathSpec.
-
setDispatcherTypes
public void setDispatcherTypes(java.util.EnumSet<javax.servlet.DispatcherType> dispatcherTypes)
-
getDispatcherTypes
public java.util.EnumSet<javax.servlet.DispatcherType> getDispatcherTypes()
-
setDispatches
public void setDispatches(int dispatches)
-
setFilterName
public void setFilterName(java.lang.String filterName)
- Parameters:
filterName
- The filterName to set.
-
setFilterHolder
void setFilterHolder(FilterHolder holder)
- Parameters:
holder
- The holder to set.
-
setPathSpecs
public void setPathSpecs(java.lang.String[] pathSpecs)
- Parameters:
pathSpecs
- The Path specifications to which this filter should be mapped.
-
setPathSpec
public void setPathSpec(java.lang.String pathSpec)
- Parameters:
pathSpec
- The pathSpec to set.
-
getServletNames
@ManagedAttribute(value="servlet names", readonly=true) public java.lang.String[] getServletNames()
- Returns:
- Returns the servletName.
-
setServletNames
public void setServletNames(java.lang.String[] servletNames)
- Parameters:
servletNames
- Maps thenamed filter
to multiple servlets- See Also:
setServletName(java.lang.String)
-
setServletName
public void setServletName(java.lang.String servletName)
- Parameters:
servletName
- Maps thenamed filter
to a single servlet- See Also:
setServletNames(java.lang.String[])
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
dump
public void dump(java.lang.Appendable out, java.lang.String indent) throws java.io.IOException
Description copied from interface:Dumpable
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.
-
-