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

public Class ServletPathMapping

extends Object
implements HttpServletMapping
Class Inheritance
All Implemented Interfaces
jakarta.servlet.http.HttpServletMapping
Imports
jakarta.servlet.http.HttpServletMapping, .HttpServletRequest, .MappingMatch, org.eclipse.jetty.http.pathmap.MatchedPath, .PathSpec, .ServletPathSpec

Implementation of HttpServletMapping. Represents the application of a ServletPathSpec to a specific path that resulted in a mapping to a jakarta.servlet.Servlet. As well as supporting the standard HttpServletMapping methods, this class also carries fields, which can be precomputed for the implementation of HttpServletRequest#getServletPath() and HttpServletRequest#getPathInfo()

Field Summary

Modifier and TypeField and Description
private final MappingMatch
private final String
private final String
private final String
private final String
private final String

Constructor Summary

AccessConstructor and Description
public
ServletPathMapping(PathSpec pathSpec, String servletName, String pathInContext, MatchedPath matchedPath)

public
ServletPathMapping(PathSpec pathSpec, String servletName, String pathInContext)

Method Summary

Modifier and TypeMethod and Description
public MappingMatch
public String
getMatchValue()

Implements jakarta.servlet.http.HttpServletMapping.getMatchValue.

Return the portion of the URI path that caused this request to be matched.

public String
public String
getPattern()

Implements jakarta.servlet.http.HttpServletMapping.getPattern.

Return the String representation for the url-pattern for this mapping.

public String
getServletName()

Implements jakarta.servlet.http.HttpServletMapping.getServletName.

Return the String representation for the servlet-name for this mapping.

public String
public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait

Field Detail

_mappingMatchback to summary
private final MappingMatch _mappingMatch
_matchValueback to summary
private final String _matchValue
_pathInfoback to summary
private final String _pathInfo
_patternback to summary
private final String _pattern
_servletNameback to summary
private final String _servletName
_servletPathback to summary
private final String _servletPath

Constructor Detail

ServletPathMappingback to summary
public ServletPathMapping(PathSpec pathSpec, String servletName, String pathInContext, MatchedPath matchedPath)
ServletPathMappingback to summary
public ServletPathMapping(PathSpec pathSpec, String servletName, String pathInContext)

Method Detail

getMappingMatchback to summary
public MappingMatch getMappingMatch()

Implements jakarta.servlet.http.HttpServletMapping.getMappingMatch.

Doc from jakarta.servlet.http.HttpServletMapping.getMappingMatch.

Return the MappingMatch for this instance

Returns:MappingMatch

the MappingMatch for this instance.

Annotations
@Override
getMatchValueback to summary
public String getMatchValue()

Implements jakarta.servlet.http.HttpServletMapping.getMatchValue.

Doc from jakarta.servlet.http.HttpServletMapping.getMatchValue.

Return the portion of the URI path that caused this request to be matched. If the getMappingMatch value is CONTEXT_ROOT or DEFAULT, this method must return the empty string. If the getMappingMatch value is EXACT, this method must return the portion of the path that matched the servlet, omitting any leading slash. If the getMappingMatch value is EXTENSION or PATH, this method must return the value that matched the '*'. See the class javadoc for examples.

Returns:String

the match.

Annotations
@Override
getPathInfoback to summary
public String getPathInfo()
getPatternback to summary
public String getPattern()

Implements jakarta.servlet.http.HttpServletMapping.getPattern.

Doc from jakarta.servlet.http.HttpServletMapping.getPattern.

Return the String representation for the url-pattern for this mapping. If the getMappingMatch value is CONTEXT_ROOT, this method must return the empty string. If the getMappingMatch value is EXTENSION, this method must return the pattern, without any leading slash. Otherwise, this method returns the pattern exactly as specified in the descriptor or Java configuration.

Returns:String

the String representation for the url-pattern for this mapping.

Annotations
@Override
getServletNameback to summary
public String getServletName()

Implements jakarta.servlet.http.HttpServletMapping.getServletName.

Doc from jakarta.servlet.http.HttpServletMapping.getServletName.

Return the String representation for the servlet-name for this mapping. If the Servlet providing the response is the default servlet, the return from this method is the name of the default servlet, which is container specific.

Returns:String

the String representation for the servlet-name for this mapping.

Annotations
@Override
getServletPathback to summary
public String getServletPath()
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