@Deprecated public class ControllerBeanNameHandlerMapping extends AbstractControllerUrlHandlerMapping
HandlerMapping that
follows a simple convention for generating URL path mappings from the bean names
of registered Controller beans
as well as @Controller annotated beans.
This is similar to BeanNameUrlHandlerMapping
but doesn't expect bean names to follow the URL convention: It turns plain bean names
into URLs by prepending a slash and optionally applying a specified prefix and/or suffix.
However, it only does so for well-known controller types,
as listed above (analogous to ControllerClassNameHandlerMapping).
ControllerClassNameHandlerMapping,
BeanNameUrlHandlerMappingloggerBEST_MATCHING_PATTERN_ATTRIBUTE, INTROSPECT_TYPE_LEVEL_MAPPING, MATRIX_VARIABLES_ATTRIBUTE, PATH_WITHIN_HANDLER_MAPPING_ATTRIBUTE, PRODUCIBLE_MEDIA_TYPES_ATTRIBUTE, URI_TEMPLATE_VARIABLES_ATTRIBUTEHIGHEST_PRECEDENCE, LOWEST_PRECEDENCE| Constructor and Description |
|---|
ControllerBeanNameHandlerMapping()
Deprecated.
|
| Modifier and Type | Method and Description |
|---|---|
protected java.lang.String[] |
buildUrlsForHandler(java.lang.String beanName,
java.lang.Class<?> beanClass)
Deprecated.
Abstract template method to be implemented by subclasses.
|
protected java.lang.String |
generatePathMapping(java.lang.String beanName)
Deprecated.
Prepends a '/' if required and appends the URL suffix to the name.
|
void |
setUrlPrefix(java.lang.String urlPrefix)
Deprecated.
Set an optional prefix to prepend to generated URL mappings.
|
void |
setUrlSuffix(java.lang.String urlSuffix)
Deprecated.
Set an optional suffix to append to generated URL mappings.
|
determineUrlsForHandler, isControllerType, isEligibleForMapping, isMultiActionControllerType, setExcludedClasses, setExcludedPackages, setIncludeAnnotatedControllersdetectHandlers, initApplicationContext, setDetectHandlersInAncestorContextsbuildPathExposingHandler, exposePathWithinMapping, exposeUriTemplateVariables, getHandlerInternal, getHandlerMap, getRootHandler, lookupHandler, match, registerHandler, registerHandler, setLazyInitHandlers, setRootHandler, setUseTrailingSlashMatch, supportsTypeLevelMappings, useTrailingSlashMatch, validateHandleradaptInterceptor, detectMappedInterceptors, extendInterceptors, getAdaptedInterceptors, getCorsConfiguration, getCorsConfigurations, getCorsHandlerExecutionChain, getCorsProcessor, getDefaultHandler, getHandler, getHandlerExecutionChain, getMappedInterceptors, getOrder, getPathMatcher, getUrlPathHelper, initInterceptors, setAlwaysUseFullPath, setCorsConfigurations, setCorsProcessor, setDefaultHandler, setInterceptors, setOrder, setPathMatcher, setRemoveSemicolonContent, setUrlDecode, setUrlPathHelpergetServletContext, getTempDir, getWebApplicationContext, initApplicationContext, initServletContext, isContextRequired, setServletContextgetApplicationContext, getMessageSourceAccessor, requiredContextClass, setApplicationContextclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetHandlerpublic ControllerBeanNameHandlerMapping()
public void setUrlPrefix(java.lang.String urlPrefix)
By default this is an empty String. If you want a prefix like "/myapp/", you can set it for all beans mapped by this mapping.
public void setUrlSuffix(java.lang.String urlSuffix)
By default this is an empty String. If you want a suffix like ".do", you can set it for all beans mapped by this mapping.
protected java.lang.String[] buildUrlsForHandler(java.lang.String beanName,
java.lang.Class<?> beanClass)
AbstractControllerUrlHandlerMappingbuildUrlsForHandler in class AbstractControllerUrlHandlerMappingbeanName - the name of the beanbeanClass - the type of the beanprotected java.lang.String generatePathMapping(java.lang.String beanName)