Class RequestMappingInfoHandlerMapping
java.lang.Object
org.springframework.context.support.ApplicationObjectSupport
org.springframework.web.context.support.WebApplicationObjectSupport
org.springframework.web.servlet.handler.AbstractHandlerMapping
org.springframework.web.servlet.handler.AbstractHandlerMethodMapping<RequestMappingInfo>
org.springframework.web.servlet.mvc.method.RequestMappingInfoHandlerMapping
- All Implemented Interfaces:
- Aware, BeanNameAware, InitializingBean, ApplicationContextAware, Ordered, ServletContextAware, HandlerMapping
- Direct Known Subclasses:
- RequestMappingHandlerMapping
public abstract class RequestMappingInfoHandlerMapping
extends AbstractHandlerMethodMapping<RequestMappingInfo>
Abstract base class for classes for which 
RequestMappingInfo defines
the mapping between a request and a handler method.- Since:
- 3.1
- Author:
- Arjen Poutsma, Rossen Stoyanchev
- 
Field SummaryFields inherited from class AbstractHandlerMappingmappingsLoggerFields inherited from class ApplicationObjectSupportloggerFields inherited from interface HandlerMappingAPI_VERSION_ATTRIBUTE, BEST_MATCHING_HANDLER_ATTRIBUTE, BEST_MATCHING_PATTERN_ATTRIBUTE, INTROSPECT_TYPE_LEVEL_MAPPING, LOOKUP_PATH, MATRIX_VARIABLES_ATTRIBUTE, PATH_WITHIN_HANDLER_MAPPING_ATTRIBUTE, PRODUCIBLE_MEDIA_TYPES_ATTRIBUTE, URI_TEMPLATE_VARIABLES_ATTRIBUTEFields inherited from interface OrderedHIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionReturn the request mapping paths that are not patterns.protected @Nullable HandlerMethodgetHandlerInternal(jakarta.servlet.http.HttpServletRequest request) Look up a handler method for the given request.protected Comparator<RequestMappingInfo> getMappingComparator(jakarta.servlet.http.HttpServletRequest request) Provide a Comparator to sort RequestMappingInfos matched to a request.protected @Nullable RequestMappingInfogetMatchingMapping(RequestMappingInfo info, jakarta.servlet.http.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 voidhandleMatch(RequestMappingInfo info, String lookupPath, jakarta.servlet.http.HttpServletRequest request) Expose URI template variables, matrix variables, and producible media types in the request.protected @Nullable HandlerMethodhandleNoMatch(Set<RequestMappingInfo> infos, String lookupPath, jakarta.servlet.http.HttpServletRequest request) Iterate all RequestMappingInfo's once again, look if any match by URL at least and raise exceptions according to what doesn't match.Methods inherited from class AbstractHandlerMethodMappingafterPropertiesSet, createHandlerMethod, detectHandlerMethods, getCandidateBeanNames, getCorsConfiguration, getHandlerMethods, getHandlerMethodsForMappingName, getMappingForMethod, getNamingStrategy, handlerMethodsInitialized, hasCorsConfigurationSource, initCorsConfiguration, initHandlerMethods, isHandler, lookupHandlerMethod, processCandidateBean, registerHandlerMethod, registerMapping, setDetectHandlerMethodsInAncestorContexts, setHandlerMethodMappingNamingStrategy, setPatternParser, unregisterMappingMethods inherited from class AbstractHandlerMappingadaptInterceptor, detectMappedInterceptors, extendInterceptors, formatMappingName, getAdaptedInterceptors, getApiVersionStrategy, getCorsConfigurationSource, getCorsHandlerExecutionChain, getCorsProcessor, getDefaultHandler, getHandler, getHandlerExecutionChain, getMappedInterceptors, getOrder, getPathMatcher, getPatternParser, getUrlPathHelper, initApplicationContext, initInterceptors, initLookupPath, setAlwaysUseFullPath, setApiVersionStrategy, setBeanName, setCorsConfigurations, setCorsConfigurationSource, setCorsProcessor, setDefaultHandler, setInterceptors, setOrder, setPathMatcher, setRemoveSemicolonContent, setUrlDecode, setUrlPathHelper, usesPathPatternsMethods inherited from class WebApplicationObjectSupportgetServletContext, getTempDir, getWebApplicationContext, initApplicationContext, initServletContext, isContextRequired, setServletContextMethods inherited from class ApplicationObjectSupportgetApplicationContext, getMessageSourceAccessor, obtainApplicationContext, requiredContextClass, setApplicationContext
- 
Constructor Details- 
RequestMappingInfoHandlerMappingprotected RequestMappingInfoHandlerMapping()
 
- 
- 
Method Details- 
getDirectPathsDescription copied from class:AbstractHandlerMethodMappingReturn the request mapping paths that are not patterns.- Overrides:
- getDirectPathsin class- AbstractHandlerMethodMapping<RequestMappingInfo>
 
- 
getMatchingMappingprotected @Nullable RequestMappingInfo getMatchingMapping(RequestMappingInfo info, jakarta.servlet.http.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.- Specified by:
- getMatchingMappingin class- AbstractHandlerMethodMapping<RequestMappingInfo>
- Parameters:
- info- the mapping to get a match for
- request- the current HTTP servlet request
- Returns:
- an info in case of a match; or nullotherwise.
 
- 
getMappingComparatorprotected Comparator<RequestMappingInfo> getMappingComparator(jakarta.servlet.http.HttpServletRequest request) Provide a Comparator to sort RequestMappingInfos matched to a request.- Specified by:
- getMappingComparatorin class- AbstractHandlerMethodMapping<RequestMappingInfo>
- Parameters:
- request- the current request
- Returns:
- the comparator (never null)
 
- 
getHandlerInternalprotected @Nullable HandlerMethod getHandlerInternal(jakarta.servlet.http.HttpServletRequest request) throws Exception Description copied from class:AbstractHandlerMethodMappingLook up a handler method for the given request.- Overrides:
- getHandlerInternalin class- AbstractHandlerMethodMapping<RequestMappingInfo>
- Parameters:
- request- current HTTP request
- Returns:
- the corresponding handler instance, or nullif none found
- Throws:
- Exception- if there is an internal error
 
- 
handleMatchprotected void handleMatch(RequestMappingInfo info, String lookupPath, jakarta.servlet.http.HttpServletRequest request) Expose URI template variables, matrix variables, and producible media types in the request.- Overrides:
- handleMatchin class- AbstractHandlerMethodMapping<RequestMappingInfo>
- Parameters:
- info- the matching mapping
- lookupPath- mapping lookup path within the current servlet mapping
- request- the current request
- See Also:
 
- 
handleNoMatchprotected @Nullable HandlerMethod handleNoMatch(Set<RequestMappingInfo> infos, String lookupPath, jakarta.servlet.http.HttpServletRequest request) throws jakarta.servlet.ServletException Iterate all RequestMappingInfo's once again, look if any match by URL at least and raise exceptions according to what doesn't match.- Overrides:
- handleNoMatchin class- AbstractHandlerMethodMapping<RequestMappingInfo>
- Parameters:
- infos- all registered mappings
- lookupPath- mapping lookup path within the current servlet mapping
- request- the current request
- Throws:
- HttpRequestMethodNotSupportedException- if there are matches by URL but not by HTTP method
- HttpMediaTypeNotAcceptableException- if there are matches by URL but not by consumable/producible media types
- jakarta.servlet.ServletException- in case of errors
 
 
-