类 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
- 所有已实现的接口:
Aware,BeanNameAware,InitializingBean,ApplicationContextAware,Ordered,ServletContextAware,HandlerMapping
- 直接已知子类:
RequestMappingHandlerMapping
public abstract class RequestMappingInfoHandlerMapping extends AbstractHandlerMethodMapping<RequestMappingInfo>
Abstract base class for classes for whichRequestMappingInfodefines the mapping between a request and a handler method.- 从以下版本开始:
- 3.1
- 作者:
- Arjen Poutsma, Rossen Stoyanchev
字段概要
从类继承的字段 org.springframework.context.support.ApplicationObjectSupport
logger
从接口继承的字段 org.springframework.web.servlet.HandlerMapping
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_ATTRIBUTE
从接口继承的字段 org.springframework.core.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
构造器概要
构造器 限定符 构造器 说明 protectedRequestMappingInfoHandlerMapping()
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 protected HandlerMethodgetHandlerInternal(HttpServletRequest request)Look up a handler method for the given request.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 the suppliedRequestMappingInfo.protected RequestMappingInfogetMatchingMapping(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 voidhandleMatch(RequestMappingInfo info, String lookupPath, HttpServletRequest request)Expose URI template variables, matrix variables, and producible media types in the request.protected HandlerMethodhandleNoMatch(Set<RequestMappingInfo> infos, String lookupPath, 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.从类继承的方法 org.springframework.web.servlet.handler.AbstractHandlerMethodMapping
afterPropertiesSet, createHandlerMethod, detectHandlerMethods, getCandidateBeanNames, getCorsConfiguration, getHandlerMethods, getHandlerMethodsForMappingName, getMappingForMethod, getNamingStrategy, handlerMethodsInitialized, hasCorsConfigurationSource, initCorsConfiguration, initHandlerMethods, isHandler, lookupHandlerMethod, processCandidateBean, registerHandlerMethod, registerMapping, setDetectHandlerMethodsInAncestorContexts, setHandlerMethodMappingNamingStrategy, unregisterMapping
从类继承的方法 org.springframework.web.servlet.handler.AbstractHandlerMapping
adaptInterceptor, detectMappedInterceptors, extendInterceptors, formatMappingName, getAdaptedInterceptors, getCorsHandlerExecutionChain, getCorsProcessor, getDefaultHandler, getHandler, getHandlerExecutionChain, getMappedInterceptors, getOrder, getPathMatcher, getUrlPathHelper, initApplicationContext, initInterceptors, setAlwaysUseFullPath, setBeanName, setCorsConfigurations, setCorsConfigurationSource, setCorsProcessor, setDefaultHandler, setInterceptors, setOrder, setPathMatcher, setRemoveSemicolonContent, setUrlDecode, setUrlPathHelper
从类继承的方法 org.springframework.web.context.support.WebApplicationObjectSupport
getServletContext, getTempDir, getWebApplicationContext, initApplicationContext, initServletContext, isContextRequired, setServletContext
从类继承的方法 org.springframework.context.support.ApplicationObjectSupport
getApplicationContext, getMessageSourceAccessor, obtainApplicationContext, requiredContextClass, setApplicationContext
构造器详细资料
RequestMappingInfoHandlerMapping
protected RequestMappingInfoHandlerMapping()
方法详细资料
getMappingPathPatterns
protected Set<String> getMappingPathPatterns(RequestMappingInfo info)
Get the URL path patterns associated with the suppliedRequestMappingInfo.
getMatchingMapping
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.- 指定者:
getMatchingMapping在类中AbstractHandlerMethodMapping<RequestMappingInfo>- 参数:
info- the mapping to get a match forrequest- the current HTTP servlet request- 返回:
- an info in case of a match; or
nullotherwise.
getMappingComparator
protected Comparator<RequestMappingInfo> getMappingComparator(HttpServletRequest request)
Provide a Comparator to sort RequestMappingInfos matched to a request.- 指定者:
getMappingComparator在类中AbstractHandlerMethodMapping<RequestMappingInfo>- 参数:
request- the current request- 返回:
- the comparator (never
null)
getHandlerInternal
protected HandlerMethod getHandlerInternal(HttpServletRequest request) throws Exception
从类复制的说明:AbstractHandlerMethodMappingLook up a handler method for the given request.- 覆盖:
getHandlerInternal在类中AbstractHandlerMethodMapping<RequestMappingInfo>- 参数:
request- current HTTP request- 返回:
- the corresponding handler instance, or
nullif none found - 抛出:
Exception- if there is an internal error
handleMatch
protected void handleMatch(RequestMappingInfo info, String lookupPath, HttpServletRequest request)
Expose URI template variables, matrix variables, and producible media types in the request.- 覆盖:
handleMatch在类中AbstractHandlerMethodMapping<RequestMappingInfo>- 参数:
info- the matching mappinglookupPath- mapping lookup path within the current servlet mappingrequest- the current request- 另请参阅:
HandlerMapping.URI_TEMPLATE_VARIABLES_ATTRIBUTE,HandlerMapping.MATRIX_VARIABLES_ATTRIBUTE,HandlerMapping.PRODUCIBLE_MEDIA_TYPES_ATTRIBUTE
handleNoMatch
protected HandlerMethod handleNoMatch(Set<RequestMappingInfo> infos, String lookupPath, HttpServletRequest request) throws ServletException
Iterate all RequestMappingInfo's once again, look if any match by URL at least and raise exceptions according to what doesn't match.- 覆盖:
handleNoMatch在类中AbstractHandlerMethodMapping<RequestMappingInfo>- 参数:
infos- all registered mappingslookupPath- mapping lookup path within the current servlet mappingrequest- the current request- 抛出:
HttpRequestMethodNotSupportedException- 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