Class 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
- All Implemented Interfaces:
- Aware,- BeanNameAware,- ApplicationContextAware,- Ordered,- ServletContextAware,- MatchableHandlerMapping,- HandlerMapping
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
 DispatcherServlet, 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.
- Author:
- Rod Johnson, Juergen Hoeller
- See Also:
- 
Field SummaryFields inherited from class org.springframework.web.servlet.handler.AbstractHandlerMappingmappingsLoggerFields inherited from class org.springframework.context.support.ApplicationObjectSupportloggerFields inherited from interface org.springframework.web.servlet.HandlerMappingBEST_MATCHING_HANDLER_ATTRIBUTE, BEST_MATCHING_PATTERN_ATTRIBUTE, INTROSPECT_TYPE_LEVEL_MAPPING, LOOKUP_PATH, MATRIX_VARIABLES_ATTRIBUTE, PATH_WITHIN_HANDLER_MAPPING_ATTRIBUTE, PRODUCIBLE_MEDIA_TYPES_ATTRIBUTE, URI_TEMPLATE_VARIABLES_ATTRIBUTEFields inherited from interface org.springframework.core.OrderedHIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionprotected String[]determineUrlsForHandler(String beanName) Checks name and aliases of the given bean for URLs, starting with "/".Methods inherited from class org.springframework.web.servlet.handler.AbstractDetectingUrlHandlerMappingdetectHandlers, initApplicationContext, setDetectHandlersInAncestorContextsMethods inherited from class org.springframework.web.servlet.handler.AbstractUrlHandlerMappingbuildPathExposingHandler, exposePathWithinMapping, exposeUriTemplateVariables, getHandlerInternal, getHandlerMap, getPathPatternHandlerMap, getRootHandler, lookupHandler, lookupHandler, match, registerHandler, registerHandler, setLazyInitHandlers, setPatternParser, setRootHandler, setUseTrailingSlashMatch, supportsTypeLevelMappings, useTrailingSlashMatch, validateHandlerMethods inherited from class org.springframework.web.servlet.handler.AbstractHandlerMappingadaptInterceptor, detectMappedInterceptors, extendInterceptors, formatMappingName, getAdaptedInterceptors, getCorsConfiguration, getCorsConfigurationSource, getCorsHandlerExecutionChain, getCorsProcessor, getDefaultHandler, getHandler, getHandlerExecutionChain, getMappedInterceptors, getOrder, getPathMatcher, getPatternParser, getUrlPathHelper, hasCorsConfigurationSource, initInterceptors, initLookupPath, setAlwaysUseFullPath, setBeanName, setCorsConfigurations, setCorsConfigurationSource, setCorsProcessor, setDefaultHandler, setInterceptors, setOrder, setPathMatcher, setRemoveSemicolonContent, setUrlDecode, setUrlPathHelper, usesPathPatternsMethods inherited from class org.springframework.web.context.support.WebApplicationObjectSupportgetServletContext, getTempDir, getWebApplicationContext, initApplicationContext, initServletContext, isContextRequired, setServletContextMethods inherited from class org.springframework.context.support.ApplicationObjectSupportgetApplicationContext, getMessageSourceAccessor, obtainApplicationContext, requiredContextClass, setApplicationContextMethods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.springframework.web.servlet.HandlerMappinggetHandler, usesPathPatternsMethods inherited from interface org.springframework.web.servlet.handler.MatchableHandlerMappinggetPatternParser
- 
Constructor Details- 
BeanNameUrlHandlerMappingpublic BeanNameUrlHandlerMapping()
 
- 
- 
Method Details- 
determineUrlsForHandlerChecks name and aliases of the given bean for URLs, starting with "/".- Specified by:
- determineUrlsForHandlerin class- AbstractDetectingUrlHandlerMapping
- Parameters:
- beanName- the name of the candidate bean
- Returns:
- the URLs determined for the bean, or an empty array if none
 
 
-