Interface HandlerMapping
- All Known Implementing Classes:
AbstractHandlerMapping
,AbstractHandlerMethodMapping
,AbstractUrlHandlerMapping
,RequestMappingHandlerMapping
,RequestMappingInfoHandlerMapping
,RouterFunctionMapping
,SimpleUrlHandlerMapping
- Since:
- 5.0
- Author:
- Rossen Stoyanchev, Sebastien Deleuze
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
Name of theattribute
that contains the mapped handler for the best matching pattern.static final String
Name of theattribute
that contains the best matching pattern within the handler mapping.static final String
Name of theattribute
that contains a map with URI variable names and a corresponding MultiValueMap of URI matrix variables for each.static final String
Name of theattribute
that contains the path within the handler mapping, in case of a pattern match such as"/static/**"
or the full relevant URI otherwise.static final String
Name of theattribute
containing the set of producible MediaType's applicable to the mapped handler.static final String
Name of theattribute
that contains the URI templates map mapping variable names to values. -
Method Summary
Modifier and TypeMethodDescriptionreactor.core.publisher.Mono<Object>
getHandler
(ServerWebExchange exchange) Return a handler for this request.
-
Field Details
-
BEST_MATCHING_HANDLER_ATTRIBUTE
Name of theattribute
that contains the mapped handler for the best matching pattern. -
BEST_MATCHING_PATTERN_ATTRIBUTE
Name of theattribute
that contains the best matching pattern within the handler mapping. -
PATH_WITHIN_HANDLER_MAPPING_ATTRIBUTE
Name of theattribute
that contains the path within the handler mapping, in case of a pattern match such as"/static/**"
or the full relevant URI otherwise.Note: This attribute is not required to be supported by all HandlerMapping implementations. URL-based HandlerMappings will typically support it but handlers should not necessarily expect this request attribute to be present in all scenarios.
-
URI_TEMPLATE_VARIABLES_ATTRIBUTE
Name of theattribute
that contains the URI templates map mapping variable names to values.Note: This attribute is not required to be supported by all HandlerMapping implementations. URL-based HandlerMappings will typically support it, but handlers should not necessarily expect this request attribute to be present in all scenarios.
-
MATRIX_VARIABLES_ATTRIBUTE
Name of theattribute
that contains a map with URI variable names and a corresponding MultiValueMap of URI matrix variables for each.Note: This attribute is not required to be supported by all HandlerMapping implementations and may also not be present depending on whether the HandlerMapping is configured to keep matrix variable content in the request URI.
-
PRODUCIBLE_MEDIA_TYPES_ATTRIBUTE
Name of theattribute
containing the set of producible MediaType's applicable to the mapped handler.Note: This attribute is not required to be supported by all HandlerMapping implementations. Handlers should not necessarily expect this request attribute to be present in all scenarios.
-
-
Method Details
-
getHandler
Return a handler for this request.Before returning a handler, an implementing method should check for CORS configuration associated with the handler, apply validation checks based on it, and update the response accordingly. For pre-flight requests, the same should be done based on the handler matching to the expected actual request.
- Parameters:
exchange
- current server exchange- Returns:
- a
Mono
that emits one value or none in case the request cannot be resolved to a handler
-