类 BeanNameUrlHandlerMapping

所有已实现的接口:
cn.taketoday.beans.factory.Aware, cn.taketoday.beans.factory.BeanNameAware, cn.taketoday.context.ApplicationContextAware, cn.taketoday.context.expression.EmbeddedValueResolverAware, cn.taketoday.core.Ordered, HandlerMapping

public class BeanNameUrlHandlerMapping extends AbstractDetectingUrlHandlerMapping
Implementation of the HandlerMapping interface that maps from URLs to beans with names that start with a slash ("/"), similar to how Struts maps URLs to action names.

This is the default implementation used by the DispatcherHandler, along with RequestMappingHandlerMapping. Alternatively, SimpleUrlHandlerMapping allows for customizing a handler mapping declaratively.

The mapping is from URL to bean name. Thus an incoming URL "/foo" would map to a handler named "/foo", or to "/foo /foo2" in case of multiple mappings to a single handler.

Supports direct matches (given "/test" -> registered "/test") and "*" matches (given "/test" -> registered "/t*"). For details on the pattern options, see the PathPattern javadoc.

Supports alias placeholder resolving

从以下版本开始:
4.0 2022/1/29 00:30
作者:
Rod Johnson, Juergen Hoeller, Harry Yang
另请参阅:
  • 构造器详细资料

    • BeanNameUrlHandlerMapping

      public BeanNameUrlHandlerMapping()
  • 方法详细资料

    • determineUrlsForHandler

      protected String[] determineUrlsForHandler(String beanName)
      Checks name and aliases of the given bean for URLs, starting with "/".
      指定者:
      determineUrlsForHandler 在类中 AbstractDetectingUrlHandlerMapping
      参数:
      beanName - the name of the candidate bean
      返回:
      the URLs determined for the bean, or an empty array if none