public class BeanNameUrlHandlerMapping extends AbstractDetectingUrlHandlerMapping
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*"). 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
AntPathMatcher
javadoc.
SimpleUrlHandlerMapping
logger
BEST_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_ATTRIBUTE
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
Constructor and Description |
---|
BeanNameUrlHandlerMapping() |
Modifier and Type | Method and Description |
---|---|
protected String[] |
determineUrlsForHandler(String beanName)
Checks name and aliases of the given bean for URLs, starting with "/".
|
detectHandlers, initApplicationContext, setDetectHandlersInAncestorContexts
buildPathExposingHandler, exposePathWithinMapping, exposeUriTemplateVariables, getHandlerInternal, getHandlerMap, getPathPatternHandlerMap, getRootHandler, lookupHandler, lookupHandler, match, registerHandler, registerHandler, setLazyInitHandlers, setPatternParser, setRootHandler, setUseTrailingSlashMatch, supportsTypeLevelMappings, useTrailingSlashMatch, validateHandler
adaptInterceptor, 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, usesPathPatterns
getServletContext, getTempDir, getWebApplicationContext, initApplicationContext, initServletContext, isContextRequired, setServletContext
getApplicationContext, getMessageSourceAccessor, obtainApplicationContext, requiredContextClass, setApplicationContext
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getPatternParser
getHandler, usesPathPatterns
protected String[] determineUrlsForHandler(String beanName)
determineUrlsForHandler
in class AbstractDetectingUrlHandlerMapping
beanName
- the name of the candidate bean