Top Description Fields Methods
org.springframework.web.servlet.handler

public Interface MatchableHandlerMapping

extends HandlerMapping
Known Direct Implementers
org.springframework.web.servlet.handler.PathPatternMatchableHandlerMapping, org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping, org.springframework.web.servlet.function.support.RouterFunctionMapping, org.springframework.web.servlet.handler.AbstractUrlHandlerMapping, org.springframework.web.servlet.handler.HandlerMappingIntrospector.LookupPathMatchableHandlerMapping
Imports
jakarta.servlet.http.HttpServletRequest, org.springframework.lang.Nullable, org.springframework.web.servlet.HandlerMapping, org.springframework.web.util.pattern.PathPatternParser

Additional interface that a HandlerMapping can implement to expose a request matching API aligned with its internal request matching configuration and implementation.
Author
Rossen Stoyanchev
Since
4.3.1
See Also
HandlerMappingIntrospector

Field Summary

Inherited from org.springframework.web.servlet.HandlerMapping:
BEST_MATCHING_HANDLER_ATTRIBUTEBEST_MATCHING_PATTERN_ATTRIBUTEINTROSPECT_TYPE_LEVEL_MAPPINGLOOKUP_PATHMATRIX_VARIABLES_ATTRIBUTEPATH_WITHIN_HANDLER_MAPPING_ATTRIBUTEPRODUCIBLE_MEDIA_TYPES_ATTRIBUTEURI_TEMPLATE_VARIABLES_ATTRIBUTE

Method Summary

Modifier and TypeMethod and Description
public default PathPatternParser
getPatternParser()

Return the parser of this HandlerMapping, if configured in which case pre-parsed patterns are used.

public RequestMatchResult

Returns:

the result from request matching, or null if none
match
(HttpServletRequest
the current request
request
,
String
the pattern to match
pattern
)

Determine whether the request matches the given pattern.

Inherited from org.springframework.web.servlet.HandlerMapping:
getHandlerusesPathPatterns

Method Detail

getPatternParserback to summary
public default PathPatternParser getPatternParser()

Return the parser of this HandlerMapping, if configured in which case pre-parsed patterns are used.

Annotations
@Nullable
Since
5.3
matchback to summary
public RequestMatchResult match(HttpServletRequest request, String pattern)

Determine whether the request matches the given pattern. Use this method when getPatternParser() returns null which means that the HandlerMapping is using String pattern matching.

Parameters
request:HttpServletRequest

the current request

pattern:String

the pattern to match

Returns:RequestMatchResult

the result from request matching, or null if none

Annotations
@Nullable