HttpServletMapping (Servlet 6.1 API Documentation - Apache Tomcat 11.0.24)
Description: declaration: package: jakarta.servlet.http, interface: HttpServletMapping

# Interface HttpServletMapping

public interface HttpServletMapping
Represents how the request from which this object was obtained was mapped to the associated servlet.

Since:
  Servlet 4.0

- ## Method Summary

  Modifier and Type
  Method
  Description
  `MappingMatch`
  `getMappingMatch()`
  Returns the type of match used to map the request to the servlet.
  `String`
  `getMatchValue()`
  Returns the value that was matched when mapping the request to the servlet.
  `String`
  `getPattern()`
  Returns the URL pattern that matched this request.
  `String`
  `getServletName()`
  Returns the name of the servlet to which the request was mapped.

- ## Method Details

  - ### getMatchValue

    String getMatchValue()
    Returns the value that was matched when mapping the request to the servlet.
    Returns:
      The value that was matched or the empty String if not known.

  - ### getPattern

    String getPattern()
    Returns the URL pattern that matched this request.
    Returns:
      The `url-pattern` that matched this request or the empty String if not known.

  - ### getServletName

    String getServletName()
    Returns the name of the servlet to which the request was mapped.
    Returns:
      The name of the servlet (as specified in web.xml, `WebServlet.name()`, `ServletContext.addServlet(String, Class)` or one of the other `addServlet()` methods) that the request was mapped to.

  - ### getMappingMatch

    MappingMatch getMappingMatch()
    Returns the type of match used to map the request to the servlet.
    Returns:
      The type of match (`null` if not known)