Save This Page
Home » spring-framework-2.5.5-with-dependencies » org.springframework » web » servlet » mvc » support » [javadoc | source]
org.springframework.web.servlet.mvc.support
public class: ControllerBeanNameHandlerMapping [javadoc | source]
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:
    HandlerMapping, Ordered, ServletContextAware, ApplicationContextAware

Implementation of org.springframework.web.servlet.HandlerMapping that follows a simple convention for generating URL path mappings from the bean names of registered org.springframework.web.servlet.mvc.Controller and org.springframework.web.servlet.mvc.throwaway.ThrowawayController beans as well as @Controller annotated beans.

This is similar to org.springframework.web.servlet.handler.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 ).

Fields inherited from org.springframework.context.support.ApplicationObjectSupport:
logger
Method from org.springframework.web.servlet.mvc.support.ControllerBeanNameHandlerMapping Summary:
buildUrlsForHandler,   generatePathMapping,   setUrlPrefix,   setUrlSuffix
Methods from org.springframework.web.servlet.mvc.support.AbstractControllerUrlHandlerMapping:
buildUrlsForHandler,   determineUrlsForHandler,   isControllerType,   isEligibleForMapping,   isMultiActionControllerType,   setExcludedClasses,   setExcludedPackages,   setIncludeAnnotatedControllers
Methods from org.springframework.web.servlet.handler.AbstractDetectingUrlHandlerMapping:
detectHandlers,   determineUrlsForHandler,   initApplicationContext,   setDetectHandlersInAncestorContexts
Methods from org.springframework.web.servlet.handler.AbstractUrlHandlerMapping:
buildPathExposingHandler,   exposePathWithinMapping,   getHandlerInternal,   getHandlerMap,   getPathMatcher,   getRootHandler,   lookupHandler,   registerHandler,   registerHandler,   setAlwaysUseFullPath,   setLazyInitHandlers,   setPathMatcher,   setRootHandler,   setUrlDecode,   setUrlPathHelper,   validateHandler
Methods from org.springframework.web.servlet.handler.AbstractHandlerMapping:
adaptInterceptor,   extendInterceptors,   getAdaptedInterceptors,   getDefaultHandler,   getHandler,   getHandlerExecutionChain,   getHandlerInternal,   getOrder,   initApplicationContext,   initInterceptors,   setDefaultHandler,   setInterceptors,   setOrder
Methods from org.springframework.web.context.support.WebApplicationObjectSupport:
getServletContext,   getTempDir,   getWebApplicationContext,   initApplicationContext,   initServletContext,   isContextRequired,   setServletContext
Methods from org.springframework.context.support.ApplicationObjectSupport:
getApplicationContext,   getMessageSourceAccessor,   initApplicationContext,   initApplicationContext,   isContextRequired,   requiredContextClass,   setApplicationContext
Methods from java.lang.Object:
equals,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from org.springframework.web.servlet.mvc.support.ControllerBeanNameHandlerMapping Detail:
 protected String[] buildUrlsForHandler(String beanName,
    Class beanClass) 
 protected String generatePathMapping(String beanName) 
    Prepends a '/' if required and appends the URL suffix to the name.
 public  void setUrlPrefix(String urlPrefix) 
    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.

 public  void setUrlSuffix(String urlSuffix) 
    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.