现在的位置: 首页 > 综合 > 正文

org.springframework.web.servlet.handler.SimpleUrlHandlerMapping

2019年05月12日 ⁄ 综合 ⁄ 共 1336字 ⁄ 字号 评论关闭
转载自:这里
org.springframework.web.servlet.handler

类 SimpleUrlHandlerMapping

  • 所有已实现的接口:
    HandlerMapping

    public class SimpleUrlHandlerMapping
    extends AbstractUrlHandlerMapping
    Implementation of the
    HandlerMapping
    interface to map from URLs to request handler beans. Supports both mapping to bean instances and mapping to bean names; the latter is required for non-singleton handlers.

    The "urlMap" property is suitable for populating the handler map with bean references, e.g. via the map element in XML bean definitions.

    Mappings to bean names can be set via the "mappings" property, in a form accepted by the
    java.util.Properties class, like as follows:
    /welcome.html=ticketController /show.html=ticketController
    The syntax is PATH=HANDLER_BEAN_NAME. If the path doesn't begin with a slash, one is prepended.

    Supports direct matches (given "/test" -> registered "/test") and "*" matches (given "/test" -> registered "/t*"). Note that the default is to map within the current servlet mapping if applicable; see the

    "alwaysUseFullPath"
    property for details. For details on the pattern options, see the
    org.springframework.util.AntPathMatcher javadoc.

    另请参阅:
    setMappings(java.util.Properties),

    setUrlMap(java.util.Map<java.lang.String, ?>)
    ,
    BeanNameUrlHandlerMapping

抱歉!评论已关闭.