类 AbstractDetectingUrlHandlerMapping
- 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.AbstractUrlHandlerMapping
- org.springframework.web.servlet.handler.AbstractDetectingUrlHandlerMapping
- 所有已实现的接口:
Aware
,ApplicationContextAware
,Ordered
,ServletContextAware
,MatchableHandlerMapping
,HandlerMapping
- 直接已知子类:
AbstractControllerUrlHandlerMapping
,BeanNameUrlHandlerMapping
,DefaultAnnotationHandlerMapping
public abstract class AbstractDetectingUrlHandlerMapping extends AbstractUrlHandlerMapping
Abstract implementation of theHandlerMapping
interface, detecting URL mappings for handler beans through introspection of all defined beans in the application context.- 从以下版本开始:
- 2.5
- 作者:
- Juergen Hoeller
- 另请参阅:
determineUrlsForHandler(java.lang.String)
字段概要
从类继承的字段 org.springframework.context.support.ApplicationObjectSupport
logger
从接口继承的字段 org.springframework.web.servlet.HandlerMapping
BEST_MATCHING_HANDLER_ATTRIBUTE, BEST_MATCHING_PATTERN_ATTRIBUTE, INTROSPECT_TYPE_LEVEL_MAPPING, MATRIX_VARIABLES_ATTRIBUTE, PATH_WITHIN_HANDLER_MAPPING_ATTRIBUTE, PRODUCIBLE_MEDIA_TYPES_ATTRIBUTE, URI_TEMPLATE_VARIABLES_ATTRIBUTE
从接口继承的字段 org.springframework.core.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
构造器概要
构造器 构造器 说明 AbstractDetectingUrlHandlerMapping()
方法概要
所有方法 实例方法 抽象方法 具体方法 修饰符和类型 方法 说明 protected void
detectHandlers()
Register all handlers found in the current ApplicationContext.protected abstract String[]
determineUrlsForHandler(String beanName)
Determine the URLs for the given handler bean.void
initApplicationContext()
Calls thedetectHandlers()
method in addition to the superclass's initialization.void
setDetectHandlersInAncestorContexts(boolean detectHandlersInAncestorContexts)
Set whether to detect handler beans in ancestor ApplicationContexts.从类继承的方法 org.springframework.web.servlet.handler.AbstractUrlHandlerMapping
buildPathExposingHandler, exposePathWithinMapping, exposeUriTemplateVariables, getHandlerInternal, getHandlerMap, getRootHandler, lookupHandler, match, registerHandler, registerHandler, setLazyInitHandlers, setRootHandler, setUseTrailingSlashMatch, supportsTypeLevelMappings, useTrailingSlashMatch, validateHandler
从类继承的方法 org.springframework.web.servlet.handler.AbstractHandlerMapping
adaptInterceptor, detectMappedInterceptors, extendInterceptors, getAdaptedInterceptors, getCorsConfiguration, getCorsConfigurations, getCorsHandlerExecutionChain, getCorsProcessor, getDefaultHandler, getHandler, getHandlerExecutionChain, getMappedInterceptors, getOrder, getPathMatcher, getUrlPathHelper, initInterceptors, setAlwaysUseFullPath, setCorsConfigurations, 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, requiredContextClass, setApplicationContext
从类继承的方法 java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
从接口继承的方法 org.springframework.web.servlet.HandlerMapping
getHandler
构造器详细资料
AbstractDetectingUrlHandlerMapping
public AbstractDetectingUrlHandlerMapping()
方法详细资料
setDetectHandlersInAncestorContexts
public void setDetectHandlersInAncestorContexts(boolean detectHandlersInAncestorContexts)
Set whether to detect handler beans in ancestor ApplicationContexts.Default is "false": Only handler beans in the current ApplicationContext will be detected, i.e. only in the context that this HandlerMapping itself is defined in (typically the current DispatcherServlet's context).
Switch this flag on to detect handler beans in ancestor contexts (typically the Spring root WebApplicationContext) as well.
initApplicationContext
public void initApplicationContext() throws ApplicationContextException
Calls thedetectHandlers()
method in addition to the superclass's initialization.- 覆盖:
initApplicationContext
在类中AbstractHandlerMapping
- 抛出:
ApplicationContextException
- in case of initialization errors- 另请参阅:
AbstractHandlerMapping.extendInterceptors(java.util.List)
,AbstractHandlerMapping.initInterceptors()
detectHandlers
protected void detectHandlers() throws BeansException
Register all handlers found in the current ApplicationContext.The actual URL determination for a handler is up to the concrete
determineUrlsForHandler(String)
implementation. A bean for which no such URLs could be determined is simply not considered a handler.- 抛出:
BeansException
- if the handler couldn't be registered- 另请参阅:
determineUrlsForHandler(String)
determineUrlsForHandler
protected abstract String[] determineUrlsForHandler(String beanName)
Determine the URLs for the given handler bean.- 参数:
beanName
- the name of the candidate bean- 返回:
- the URLs determined for the bean, or
null
or an empty array if none