类 AbstractDetectingUrlHandlerMapping

java.lang.Object
cn.taketoday.context.support.ApplicationObjectSupport
所有已实现的接口:
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

public abstract class AbstractDetectingUrlHandlerMapping extends AbstractUrlHandlerMapping
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
另请参阅:
  • 字段详细资料

    • 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.ApplicationContextException
      Calls the detectHandlers() method in addition to the superclass's initialization.
      覆盖:
      initApplicationContext 在类中 AbstractHandlerMapping
      抛出:
      cn.taketoday.context.ApplicationContextException
      另请参阅:
    • detectHandlers

      protected void detectHandlers() throws cn.taketoday.beans.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.

      抛出:
      cn.taketoday.beans.BeansException - if the handler couldn't be registered
      另请参阅:
    • 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 an empty array if none