This version is still in development and is not considered stable yet. For the latest stable version, please use Spring Boot 3.4.0!spring-doc.cn

Mappings (mappings)

The mappings endpoint provides information about the application’s request mappings.spring-doc.cn

Retrieving the Mappings

To retrieve the mappings, make a GET request to /actuator/mappings, as shown in the following curl-based example:spring-doc.cn

$ curl 'http://localhost:42221/actuator/mappings' -i -X GET \
    -H 'accept-encoding: gzip' \
    -H 'user-agent: ReactorNetty/1.2.0' \
    -H 'accept: */*'

The resulting response is similar to the following:spring-doc.cn

HTTP/1.1 200 OK
Content-Type: application/vnd.spring-boot.actuator.v3+json
Transfer-Encoding: chunked
Date: Fri, 29 Nov 2024 09:49:47 GMT
Content-Length: 5342

{
  "contexts" : {
    "application" : {
      "mappings" : {
        "dispatcherServlets" : {
          "dispatcherServlet" : [ {
            "handler" : "Actuator web endpoint 'mappings'",
            "predicate" : "{GET [/actuator/mappings], produces [application/vnd.spring-boot.actuator.v3+json || application/vnd.spring-boot.actuator.v2+json || application/json]}",
            "details" : {
              "handlerMethod" : {
                "className" : "org.springframework.boot.actuate.endpoint.web.servlet.AbstractWebMvcEndpointHandlerMapping.OperationHandler",
                "name" : "handle",
                "descriptor" : "(Ljakarta/servlet/http/HttpServletRequest;Ljava/util/Map;)Ljava/lang/Object;"
              },
              "requestMappingConditions" : {
                "consumes" : [ ],
                "headers" : [ ],
                "methods" : [ "GET" ],
                "params" : [ ],
                "patterns" : [ "/actuator/mappings" ],
                "produces" : [ {
                  "mediaType" : "application/vnd.spring-boot.actuator.v3+json",
                  "negated" : false
                }, {
                  "mediaType" : "application/vnd.spring-boot.actuator.v2+json",
                  "negated" : false
                }, {
                  "mediaType" : "application/json",
                  "negated" : false
                } ]
              }
            }
          }, {
            "handler" : "Actuator root web endpoint",
            "predicate" : "{GET [/actuator], produces [application/vnd.spring-boot.actuator.v3+json || application/vnd.spring-boot.actuator.v2+json || application/json]}",
            "details" : {
              "handlerMethod" : {
                "className" : "org.springframework.boot.actuate.endpoint.web.servlet.WebMvcEndpointHandlerMapping.WebMvcLinksHandler",
                "name" : "links",
                "descriptor" : "(Ljakarta/servlet/http/HttpServletRequest;Ljakarta/servlet/http/HttpServletResponse;)Ljava/util/Map;"
              },
              "requestMappingConditions" : {
                "consumes" : [ ],
                "headers" : [ ],
                "methods" : [ "GET" ],
                "params" : [ ],
                "patterns" : [ "/actuator" ],
                "produces" : [ {
                  "mediaType" : "application/vnd.spring-boot.actuator.v3+json",
                  "negated" : false
                }, {
                  "mediaType" : "application/vnd.spring-boot.actuator.v2+json",
                  "negated" : false
                }, {
                  "mediaType" : "application/json",
                  "negated" : false
                } ]
              }
            }
          }, {
            "handler" : "org.springframework.boot.actuate.autoconfigure.endpoint.web.documentation.MappingsEndpointServletDocumentationTests$ExampleController#example()",
            "predicate" : "{POST [/], params [a!=alpha], headers [X-Custom=Foo], consumes [application/json || !application/xml], produces [text/plain]}",
            "details" : {
              "handlerMethod" : {
                "className" : "org.springframework.boot.actuate.autoconfigure.endpoint.web.documentation.MappingsEndpointServletDocumentationTests.ExampleController",
                "name" : "example",
                "descriptor" : "()Ljava/lang/String;"
              },
              "requestMappingConditions" : {
                "consumes" : [ {
                  "mediaType" : "application/json",
                  "negated" : false
                }, {
                  "mediaType" : "application/xml",
                  "negated" : true
                } ],
                "headers" : [ {
                  "name" : "X-Custom",
                  "value" : "Foo",
                  "negated" : false
                } ],
                "methods" : [ "POST" ],
                "params" : [ {
                  "name" : "a",
                  "value" : "alpha",
                  "negated" : true
                } ],
                "patterns" : [ "/" ],
                "produces" : [ {
                  "mediaType" : "text/plain",
                  "negated" : false
                } ]
              }
            }
          }, {
            "handler" : "ResourceHttpRequestHandler [classpath [META-INF/resources/webjars/]]",
            "predicate" : "/webjars/**"
          }, {
            "handler" : "ResourceHttpRequestHandler [classpath [META-INF/resources/], classpath [resources/], classpath [static/], classpath [public/], ServletContext [/]]",
            "predicate" : "/**"
          } ]
        },
        "servletFilters" : [ {
          "urlPatternMappings" : [ "/*" ],
          "servletNameMappings" : [ ],
          "name" : "requestContextFilter",
          "className" : "org.springframework.boot.web.servlet.filter.OrderedRequestContextFilter"
        }, {
          "urlPatternMappings" : [ "/*" ],
          "servletNameMappings" : [ ],
          "name" : "formContentFilter",
          "className" : "org.springframework.boot.web.servlet.filter.OrderedFormContentFilter"
        } ],
        "servlets" : [ {
          "mappings" : [ "/" ],
          "name" : "dispatcherServlet",
          "className" : "org.springframework.web.servlet.DispatcherServlet"
        } ]
      }
    }
  }
}

Response Structure

The response contains details of the application’s mappings. The items found in the response depend on the type of web application (reactive or Servlet-based). The following table describes the structure of the common elements of the response:spring-doc.cn

Path Type Description

contextsspring-doc.cn

Objectspring-doc.cn

Application contexts keyed by id.spring-doc.cn

contexts.*.mappingsspring-doc.cn

Objectspring-doc.cn

Mappings in the context, keyed by mapping type.spring-doc.cn

contexts.*.mappings.dispatcherServletsspring-doc.cn

Objectspring-doc.cn

Dispatcher servlet mappings, if any.spring-doc.cn

contexts.*.mappings.servletFiltersspring-doc.cn

Arrayspring-doc.cn

Servlet filter mappings, if any.spring-doc.cn

contexts.*.mappings.servletsspring-doc.cn

Arrayspring-doc.cn

Servlet mappings, if any.spring-doc.cn

contexts.*.mappings.dispatcherHandlersspring-doc.cn

Objectspring-doc.cn

Dispatcher handler mappings, if any.spring-doc.cn

contexts.*.parentIdspring-doc.cn

Stringspring-doc.cn

Id of the parent application context, if any.spring-doc.cn

The entries that may be found in contexts.*.mappings are described in the following sections.spring-doc.cn

Dispatcher Servlets Response Structure

When using Spring MVC, the response contains details of any DispatcherServlet request mappings beneath contexts.*.mappings.dispatcherServlets. The following table describes the structure of this section of the response:spring-doc.cn

Path Type Description

*spring-doc.cn

Arrayspring-doc.cn

Dispatcher servlet mappings, if any, keyed by dispatcher servlet bean name.spring-doc.cn

*.[].detailsspring-doc.cn

Objectspring-doc.cn

Additional implementation-specific details about the mapping. Optional.spring-doc.cn

*.[].handlerspring-doc.cn

Stringspring-doc.cn

Handler for the mapping.spring-doc.cn

*.[].predicatespring-doc.cn

Stringspring-doc.cn

Predicate for the mapping.spring-doc.cn

*.[].details.handlerMethodspring-doc.cn

Objectspring-doc.cn

Details of the method, if any, that will handle requests to this mapping.spring-doc.cn

*.[].details.handlerMethod.classNamespring-doc.cn

Variesspring-doc.cn

Fully qualified name of the class of the method.spring-doc.cn

*.[].details.handlerMethod.namespring-doc.cn

Variesspring-doc.cn

Name of the method.spring-doc.cn

*.[].details.handlerMethod.descriptorspring-doc.cn

Variesspring-doc.cn

Descriptor of the method as specified in the Java Language Specification.spring-doc.cn

*.[].details.requestMappingConditionsspring-doc.cn

Objectspring-doc.cn

Details of the request mapping conditions.spring-doc.cn

*.[].details.requestMappingConditions.consumesspring-doc.cn

Variesspring-doc.cn

Details of the consumes conditionspring-doc.cn

*.[].details.requestMappingConditions.consumes.[].mediaTypespring-doc.cn

Variesspring-doc.cn

Consumed media type.spring-doc.cn

*.[].details.requestMappingConditions.consumes.[].negatedspring-doc.cn

Variesspring-doc.cn

Whether the media type is negated.spring-doc.cn

*.[].details.requestMappingConditions.headersspring-doc.cn

Variesspring-doc.cn

Details of the headers condition.spring-doc.cn

*.[].details.requestMappingConditions.headers.[].namespring-doc.cn

Variesspring-doc.cn

Name of the header.spring-doc.cn

*.[].details.requestMappingConditions.headers.[].valuespring-doc.cn

Variesspring-doc.cn

Required value of the header, if any.spring-doc.cn

*.[].details.requestMappingConditions.headers.[].negatedspring-doc.cn

Variesspring-doc.cn

Whether the value is negated.spring-doc.cn

*.[].details.requestMappingConditions.methodsspring-doc.cn

Variesspring-doc.cn

HTTP methods that are handled.spring-doc.cn

*.[].details.requestMappingConditions.paramsspring-doc.cn

Variesspring-doc.cn

Details of the params condition.spring-doc.cn

*.[].details.requestMappingConditions.params.[].namespring-doc.cn

Variesspring-doc.cn

Name of the parameter.spring-doc.cn

*.[].details.requestMappingConditions.params.[].valuespring-doc.cn

Variesspring-doc.cn

Required value of the parameter, if any.spring-doc.cn

*.[].details.requestMappingConditions.params.[].negatedspring-doc.cn

Variesspring-doc.cn

Whether the value is negated.spring-doc.cn

*.[].details.requestMappingConditions.patternsspring-doc.cn

Variesspring-doc.cn

Patterns identifying the paths handled by the mapping.spring-doc.cn

*.[].details.requestMappingConditions.producesspring-doc.cn

Variesspring-doc.cn

Details of the produces condition.spring-doc.cn

*.[].details.requestMappingConditions.produces.[].mediaTypespring-doc.cn

Variesspring-doc.cn

Produced media type.spring-doc.cn

*.[].details.requestMappingConditions.produces.[].negatedspring-doc.cn

Variesspring-doc.cn

Whether the media type is negated.spring-doc.cn

Servlets Response Structure

When using the Servlet stack, the response contains details of any Servlet mappings beneath contexts.*.mappings.servlets. The following table describes the structure of this section of the response:spring-doc.cn

Path Type Description

[].mappingsspring-doc.cn

Arrayspring-doc.cn

Mappings of the servlet.spring-doc.cn

[].namespring-doc.cn

Stringspring-doc.cn

Name of the servlet.spring-doc.cn

[].classNamespring-doc.cn

Stringspring-doc.cn

Class name of the servletspring-doc.cn

Servlet Filters Response Structure

When using the Servlet stack, the response contains details of any Filter mappings beneath contexts.*.mappings.servletFilters. The following table describes the structure of this section of the response:spring-doc.cn

Path Type Description

[].servletNameMappingsspring-doc.cn

Arrayspring-doc.cn

Names of the servlets to which the filter is mapped.spring-doc.cn

[].urlPatternMappingsspring-doc.cn

Arrayspring-doc.cn

URL pattern to which the filter is mapped.spring-doc.cn

[].namespring-doc.cn

Stringspring-doc.cn

Name of the filter.spring-doc.cn

[].classNamespring-doc.cn

Stringspring-doc.cn

Class name of the filterspring-doc.cn

Dispatcher Handlers Response Structure

When using Spring WebFlux, the response contains details of any DispatcherHandler request mappings beneath contexts.*.mappings.dispatcherHandlers. The following table describes the structure of this section of the response:spring-doc.cn

Path Type Description

*spring-doc.cn

Arrayspring-doc.cn

Dispatcher handler mappings, if any, keyed by dispatcher handler bean name.spring-doc.cn

*.[].detailsspring-doc.cn

Objectspring-doc.cn

Additional implementation-specific details about the mapping. Optional.spring-doc.cn

*.[].handlerspring-doc.cn

Stringspring-doc.cn

Handler for the mapping.spring-doc.cn

*.[].predicatespring-doc.cn

Stringspring-doc.cn

Predicate for the mapping.spring-doc.cn

*.[].details.requestMappingConditionsspring-doc.cn

Objectspring-doc.cn

Details of the request mapping conditions.spring-doc.cn

*.[].details.requestMappingConditions.consumesspring-doc.cn

Variesspring-doc.cn

Details of the consumes conditionspring-doc.cn

*.[].details.requestMappingConditions.consumes.[].mediaTypespring-doc.cn

Variesspring-doc.cn

Consumed media type.spring-doc.cn

*.[].details.requestMappingConditions.consumes.[].negatedspring-doc.cn

Variesspring-doc.cn

Whether the media type is negated.spring-doc.cn

*.[].details.requestMappingConditions.headersspring-doc.cn

Variesspring-doc.cn

Details of the headers condition.spring-doc.cn

*.[].details.requestMappingConditions.headers.[].namespring-doc.cn

Variesspring-doc.cn

Name of the header.spring-doc.cn

*.[].details.requestMappingConditions.headers.[].valuespring-doc.cn

Variesspring-doc.cn

Required value of the header, if any.spring-doc.cn

*.[].details.requestMappingConditions.headers.[].negatedspring-doc.cn

Variesspring-doc.cn

Whether the value is negated.spring-doc.cn

*.[].details.requestMappingConditions.methodsspring-doc.cn

Variesspring-doc.cn

HTTP methods that are handled.spring-doc.cn

*.[].details.requestMappingConditions.paramsspring-doc.cn

Variesspring-doc.cn

Details of the params condition.spring-doc.cn

*.[].details.requestMappingConditions.params.[].namespring-doc.cn

Variesspring-doc.cn

Name of the parameter.spring-doc.cn

*.[].details.requestMappingConditions.params.[].valuespring-doc.cn

Variesspring-doc.cn

Required value of the parameter, if any.spring-doc.cn

*.[].details.requestMappingConditions.params.[].negatedspring-doc.cn

Variesspring-doc.cn

Whether the value is negated.spring-doc.cn

*.[].details.requestMappingConditions.patternsspring-doc.cn

Variesspring-doc.cn

Patterns identifying the paths handled by the mapping.spring-doc.cn

*.[].details.requestMappingConditions.producesspring-doc.cn

Variesspring-doc.cn

Details of the produces condition.spring-doc.cn

*.[].details.requestMappingConditions.produces.[].mediaTypespring-doc.cn

Variesspring-doc.cn

Produced media type.spring-doc.cn

*.[].details.requestMappingConditions.produces.[].negatedspring-doc.cn

Variesspring-doc.cn

Whether the media type is negated.spring-doc.cn

*.[].details.handlerMethodspring-doc.cn

Objectspring-doc.cn

Details of the method, if any, that will handle requests to this mapping.spring-doc.cn

*.[].details.handlerMethod.classNamespring-doc.cn

Stringspring-doc.cn

Fully qualified name of the class of the method.spring-doc.cn

*.[].details.handlerMethod.namespring-doc.cn

Stringspring-doc.cn

Name of the method.spring-doc.cn

*.[].details.handlerMethod.descriptorspring-doc.cn

Stringspring-doc.cn

Descriptor of the method as specified in the Java Language Specification.spring-doc.cn

*.[].details.handlerFunctionspring-doc.cn

Objectspring-doc.cn

Details of the function, if any, that will handle requests to this mapping.spring-doc.cn

*.[].details.handlerFunction.classNamespring-doc.cn

Stringspring-doc.cn

Fully qualified name of the class of the function.spring-doc.cn