类 AbstractDetectingUrlHandlerMapping
java.lang.Object
cn.taketoday.context.support.ApplicationObjectSupport
cn.taketoday.web.handler.AbstractHandlerMapping
cn.taketoday.web.handler.AbstractUrlHandlerMapping
cn.taketoday.web.handler.AbstractDetectingUrlHandlerMapping
- 所有已实现的接口:
cn.taketoday.beans.factory.Aware,cn.taketoday.beans.factory.BeanNameAware,cn.taketoday.context.ApplicationContextAware,cn.taketoday.context.expression.EmbeddedValueResolverAware,cn.taketoday.core.Ordered,HandlerMapping
- 直接已知子类:
BeanNameUrlHandlerMapping
Abstract implementation of the
HandlerMapping interface,
detecting URL mappings for handler beans through introspection of all
defined beans in the application context.- 从以下版本开始:
- 4.0 2022/1/29 00:26
- 作者:
- Juergen Hoeller, Harry Yang
- 另请参阅:
-
字段概要
字段从类继承的字段 cn.taketoday.web.handler.AbstractHandlerMapping
embeddedValueResolver, mappingsLogger从类继承的字段 cn.taketoday.context.support.ApplicationObjectSupport
applicationContext, log, messageSourceAccessor从接口继承的字段 cn.taketoday.web.HandlerMapping
HANDLER_MAPPING_BEAN_NAME从接口继承的字段 cn.taketoday.core.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE -
构造器概要
构造器 -
方法概要
修饰符和类型方法说明protected voidRegister all handlers found in the current ApplicationContext.protected abstract String[]determineUrlsForHandler(String beanName) Determine the URLs for the given handler bean.voidCalls thedetectHandlers()method in addition to the superclass's initialization.voidsetDetectHandlersInAncestorContexts(boolean detectHandlersInAncestorContexts) Set whether to detect handler beans in ancestor ApplicationContexts.从类继承的方法 cn.taketoday.web.handler.AbstractUrlHandlerMapping
doPutPathPattern, duPutHandler, getHandlerInternal, getHandlerMap, getPathPatternHandlerMap, getRootHandler, lookupHandler, registerHandler, registerHandler, setLazyInitHandlers, setRootHandler, validateHandler从类继承的方法 cn.taketoday.web.handler.AbstractHandlerMapping
detectMappedInterceptors, extendInterceptors, formatMappingName, getCorsConfiguration, getCorsConfigurationSource, getCorsHandlerExecutionChain, getCorsProcessor, getDefaultHandler, getHandler, getHandlerExecutionChain, getHandlerInterceptors, getOrder, getPatternParser, hasCorsConfigurationSource, resolveEmbeddedVariables, setBeanName, setCorsConfigurations, setCorsConfigurationSource, setCorsProcessor, setDefaultHandler, setEmbeddedValueResolver, setInterceptors, setOrder, setUseCaseSensitiveMatch, setUseTrailingSlashMatch从类继承的方法 cn.taketoday.context.support.ApplicationObjectSupport
getApplicationContext, getMessageSourceAccessor, initApplicationContext, isContextRequired, obtainApplicationContext, requiredContextClass, setApplicationContext, unwrapContext, unwrapFactory
-
字段详细资料
-
detectHandlersInAncestorContexts
private boolean detectHandlersInAncestorContexts
-
-
构造器详细资料
-
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 root WebApplicationContext) as well.
-
initApplicationContext
public void initApplicationContext() throws cn.taketoday.context.ApplicationContextExceptionCalls thedetectHandlers()method in addition to the superclass's initialization.- 覆盖:
initApplicationContext在类中AbstractHandlerMapping- 抛出:
cn.taketoday.context.ApplicationContextException- 另请参阅:
-
detectHandlers
protected void detectHandlers() throws cn.taketoday.beans.BeansExceptionRegister 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.- 抛出:
cn.taketoday.beans.BeansException- if the handler couldn't be registered- 另请参阅:
-
determineUrlsForHandler
Determine the URLs for the given handler bean.- 参数:
beanName- the name of the candidate bean- 返回:
- the URLs determined for the bean, or an empty array if none
-