public abstract class RequestMappingInfoHandlerMapping extends AbstractHandlerMethodMapping<RequestMappingInfo>
RequestMappingInfo
defines
the mapping between a request and a handler method.logger
BEST_MATCHING_PATTERN_ATTRIBUTE, INTROSPECT_TYPE_LEVEL_MAPPING, MATRIX_VARIABLES_ATTRIBUTE, PATH_WITHIN_HANDLER_MAPPING_ATTRIBUTE, PRODUCIBLE_MEDIA_TYPES_ATTRIBUTE, URI_TEMPLATE_VARIABLES_ATTRIBUTE
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
Modifier | Constructor and Description |
---|---|
protected |
RequestMappingInfoHandlerMapping() |
Modifier and Type | Method and Description |
---|---|
protected Comparator<RequestMappingInfo> |
getMappingComparator(HttpServletRequest request)
Provide a Comparator to sort RequestMappingInfos matched to a request.
|
protected Set<String> |
getMappingPathPatterns(RequestMappingInfo info)
Get the URL path patterns associated with this
RequestMappingInfo . |
protected RequestMappingInfo |
getMatchingMapping(RequestMappingInfo info,
HttpServletRequest request)
Check if the given RequestMappingInfo matches the current request and
return a (potentially new) instance with conditions that match the
current request -- for example with a subset of URL patterns.
|
protected void |
handleMatch(RequestMappingInfo info,
String lookupPath,
HttpServletRequest request)
Expose URI template variables, matrix variables, and producible media types in the request.
|
protected HandlerMethod |
handleNoMatch(Set<RequestMappingInfo> requestMappingInfos,
String lookupPath,
HttpServletRequest request)
Iterate all RequestMappingInfos once again, look if any match by URL at
least and raise exceptions accordingly.
|
afterPropertiesSet, createHandlerMethod, detectHandlerMethods, getHandlerInternal, getHandlerMethods, getHandlerMethodsForMappingName, getMappingForMethod, handlerMethodsInitialized, initHandlerMethods, isHandler, lookupHandlerMethod, registerHandlerMethod, setDetectHandlerMethodsInAncestorContexts, setHandlerMethodMappingNamingStrategy
adaptInterceptor, detectMappedInterceptors, extendInterceptors, getAdaptedInterceptors, getDefaultHandler, getHandler, getHandlerExecutionChain, getMappedInterceptors, getOrder, getPathMatcher, getUrlPathHelper, initApplicationContext, initInterceptors, setAlwaysUseFullPath, setDefaultHandler, setInterceptors, setOrder, setPathMatcher, setRemoveSemicolonContent, setUrlDecode, setUrlPathHelper
getServletContext, getTempDir, getWebApplicationContext, initApplicationContext, initServletContext, isContextRequired, setServletContext
getApplicationContext, getMessageSourceAccessor, requiredContextClass, setApplicationContext
protected Set<String> getMappingPathPatterns(RequestMappingInfo info)
RequestMappingInfo
.getMappingPathPatterns
in class AbstractHandlerMethodMapping<RequestMappingInfo>
protected RequestMappingInfo getMatchingMapping(RequestMappingInfo info, HttpServletRequest request)
getMatchingMapping
in class AbstractHandlerMethodMapping<RequestMappingInfo>
info
- the mapping to get a match forrequest
- the current HTTP servlet requestnull
otherwise.protected Comparator<RequestMappingInfo> getMappingComparator(HttpServletRequest request)
getMappingComparator
in class AbstractHandlerMethodMapping<RequestMappingInfo>
request
- the current requestnull
protected void handleMatch(RequestMappingInfo info, String lookupPath, HttpServletRequest request)
handleMatch
in class AbstractHandlerMethodMapping<RequestMappingInfo>
info
- the matching mappinglookupPath
- mapping lookup path within the current servlet mappingrequest
- the current requestHandlerMapping.URI_TEMPLATE_VARIABLES_ATTRIBUTE
,
HandlerMapping.MATRIX_VARIABLES_ATTRIBUTE
,
HandlerMapping.PRODUCIBLE_MEDIA_TYPES_ATTRIBUTE
protected HandlerMethod handleNoMatch(Set<RequestMappingInfo> requestMappingInfos, String lookupPath, HttpServletRequest request) throws ServletException
handleNoMatch
in class AbstractHandlerMethodMapping<RequestMappingInfo>
requestMappingInfos
- all registered mappingslookupPath
- mapping lookup path within the current servlet mappingrequest
- the current requestHttpRequestMethodNotSupportedException
- if there are matches by URL
but not by HTTP methodHttpMediaTypeNotAcceptableException
- if there are matches by URL
but not by consumable/producible media typesServletException
- in case of errors