Class ControllerBeanNameHandlerMapping
- 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.mvc.support.AbstractControllerUrlHandlerMapping
- org.springframework.web.servlet.mvc.support.ControllerBeanNameHandlerMapping
- All Implemented Interfaces:
Aware
,ApplicationContextAware
,Ordered
,ServletContextAware
,MatchableHandlerMapping
,HandlerMapping
@Deprecated public class ControllerBeanNameHandlerMapping extends AbstractControllerUrlHandlerMapping
Deprecated.as of 4.3, in favor of annotation-driven handler methodsImplementation ofHandlerMapping
that follows a simple convention for generating URL path mappings from the bean names of registeredController
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-knowncontroller types
, as listed above (analogous toControllerClassNameHandlerMapping
).- Since:
- 2.5.3
- Author:
- Juergen Hoeller
- See Also:
ControllerClassNameHandlerMapping
,BeanNameUrlHandlerMapping
Field Summary
Fields inherited from class org.springframework.context.support.ApplicationObjectSupport
logger
Fields inherited from interface 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
Fields inherited from interface org.springframework.core.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
Constructor Summary
Constructors Constructor Description ControllerBeanNameHandlerMapping()
Deprecated.
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description protected String[]
buildUrlsForHandler(String beanName, Class<?> beanClass)
Deprecated.Abstract template method to be implemented by subclasses.protected String
generatePathMapping(String beanName)
Deprecated.Prepends a '/' if required and appends the URL suffix to the name.void
setUrlPrefix(String urlPrefix)
Deprecated.Set an optional prefix to prepend to generated URL mappings.void
setUrlSuffix(String urlSuffix)
Deprecated.Set an optional suffix to append to generated URL mappings.Methods inherited from class org.springframework.web.servlet.mvc.support.AbstractControllerUrlHandlerMapping
determineUrlsForHandler, isControllerType, isEligibleForMapping, isMultiActionControllerType, setExcludedClasses, setExcludedPackages, setIncludeAnnotatedControllers
Methods inherited from class org.springframework.web.servlet.handler.AbstractDetectingUrlHandlerMapping
detectHandlers, initApplicationContext, setDetectHandlersInAncestorContexts
Methods inherited from class org.springframework.web.servlet.handler.AbstractUrlHandlerMapping
buildPathExposingHandler, exposePathWithinMapping, exposeUriTemplateVariables, getHandlerInternal, getHandlerMap, getRootHandler, lookupHandler, match, registerHandler, registerHandler, setLazyInitHandlers, setRootHandler, setUseTrailingSlashMatch, supportsTypeLevelMappings, useTrailingSlashMatch, validateHandler
Methods inherited from class 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
Methods inherited from class org.springframework.web.context.support.WebApplicationObjectSupport
getServletContext, getTempDir, getWebApplicationContext, initApplicationContext, initServletContext, isContextRequired, setServletContext
Methods inherited from class org.springframework.context.support.ApplicationObjectSupport
getApplicationContext, getMessageSourceAccessor, requiredContextClass, setApplicationContext
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.springframework.web.servlet.HandlerMapping
getHandler
Constructor Detail
ControllerBeanNameHandlerMapping
public ControllerBeanNameHandlerMapping()
Deprecated.
Method Detail
setUrlPrefix
public void setUrlPrefix(String urlPrefix)
Deprecated.Set an optional prefix to prepend to generated URL mappings.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.
setUrlSuffix
public void setUrlSuffix(String urlSuffix)
Deprecated.Set an optional suffix to append to generated URL mappings.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.
buildUrlsForHandler
protected String[] buildUrlsForHandler(String beanName, Class<?> beanClass)
Deprecated.Description copied from class:AbstractControllerUrlHandlerMapping
Abstract template method to be implemented by subclasses.- Specified by:
buildUrlsForHandler
in classAbstractControllerUrlHandlerMapping
- Parameters:
beanName
- the name of the beanbeanClass
- the type of the bean- Returns:
- the URLs determined for the bean
generatePathMapping
protected String generatePathMapping(String beanName)
Deprecated.Prepends a '/' if required and appends the URL suffix to the name.