类 BeanNameUrlHandlerMapping
- 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
- org.springframework.web.servlet.handler.BeanNameUrlHandlerMapping
- 所有已实现的接口:
Aware
,ApplicationContextAware
,Ordered
,ServletContextAware
,MatchableHandlerMapping
,HandlerMapping
public class BeanNameUrlHandlerMapping extends AbstractDetectingUrlHandlerMapping
Implementation of theHandlerMapping
interface that map 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
DispatcherServlet
, along withDefaultAnnotationHandlerMapping
. 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. Note: In XML definitions, you'll need to use an alias name="/foo" in the bean definition, as the XML id may not contain slashes.
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 theAntPathMatcher
javadoc.- 作者:
- Rod Johnson, Juergen Hoeller
- 另请参阅:
SimpleUrlHandlerMapping
字段概要
从类继承的字段 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
构造器概要
构造器 构造器 说明 BeanNameUrlHandlerMapping()
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 protected String[]
determineUrlsForHandler(String beanName)
Checks name and aliases of the given bean for URLs, starting with "/".从类继承的方法 org.springframework.web.servlet.handler.AbstractDetectingUrlHandlerMapping
detectHandlers, initApplicationContext, setDetectHandlersInAncestorContexts
从类继承的方法 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
构造器详细资料
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
null
or an empty array if none