org.parancoe.web.controller
Class AnnotationHandlerMapping

java.lang.Object
  extended by org.springframework.context.support.ApplicationObjectSupport
      extended by org.springframework.web.context.support.WebApplicationObjectSupport
          extended by org.springframework.web.servlet.handler.AbstractHandlerMapping
              extended by org.springframework.web.servlet.handler.AbstractUrlHandlerMapping
                  extended by org.springframework.web.servlet.handler.BeanNameUrlHandlerMapping
                      extended by org.parancoe.web.controller.AnnotationHandlerMapping
All Implemented Interfaces:
org.springframework.context.ApplicationContextAware, org.springframework.core.Ordered, org.springframework.web.context.ServletContextAware, org.springframework.web.servlet.HandlerMapping

public class AnnotationHandlerMapping
extends org.springframework.web.servlet.handler.BeanNameUrlHandlerMapping

An HandlerMapping implementation that reads url mapping from annotations. Annotation supported are:

  1. DefaultUrlMapping
  2. UrlMapping
  3. MultiUrlMapping
This handlerMapping inherits directly from BeanNameUrlHandlerMapping, in this way it's still possible to map urls to controller using the 'name' attribute.

Version:
$Revision$
Author:
Andrea Nasato

Field Summary
 
Fields inherited from interface org.springframework.web.servlet.HandlerMapping
PATH_WITHIN_HANDLER_MAPPING_ATTRIBUTE
 
Fields inherited from interface org.springframework.core.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
 
Constructor Summary
AnnotationHandlerMapping()
           
 
Method Summary
 java.lang.String getDefaultExtension()
           
 void initApplicationContext()
           
protected  void registerHandlers()
          Iterates over beans of type Controller registered in the current spring context searching for UrlAnnotation and MultiUrlAnnotation.
 void setDefaultExtension(java.lang.String defaultExtension)
           
 
Methods inherited from class org.springframework.web.servlet.handler.BeanNameUrlHandlerMapping
detectHandlers, determineUrlsForHandler, setDetectHandlersInAncestorContexts
 
Methods inherited from class org.springframework.web.servlet.handler.AbstractUrlHandlerMapping
exposePathWithinMapping, getHandlerInternal, getHandlerMap, getRootHandler, lookupHandler, registerHandler, registerHandler, setAlwaysUseFullPath, setLazyInitHandlers, setPathMatcher, setRootHandler, setUrlDecode, setUrlPathHelper
 
Methods inherited from class org.springframework.web.servlet.handler.AbstractHandlerMapping
adaptInterceptor, extendInterceptors, getAdaptedInterceptors, getDefaultHandler, getHandler, getHandlerExecutionChain, getOrder, initInterceptors, setDefaultHandler, setInterceptors, setOrder
 
Methods inherited from class org.springframework.web.context.support.WebApplicationObjectSupport
getServletContext, getTempDir, getWebApplicationContext, 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
 

Constructor Detail

AnnotationHandlerMapping

public AnnotationHandlerMapping()
Method Detail

initApplicationContext

public void initApplicationContext()
                            throws org.springframework.context.ApplicationContextException
Overrides:
initApplicationContext in class org.springframework.web.servlet.handler.BeanNameUrlHandlerMapping
Throws:
org.springframework.context.ApplicationContextException

setDefaultExtension

public void setDefaultExtension(java.lang.String defaultExtension)

getDefaultExtension

public java.lang.String getDefaultExtension()

registerHandlers

protected void registerHandlers()
Iterates over beans of type Controller registered in the current spring context searching for UrlAnnotation and MultiUrlAnnotation. If a controller doesn't have annotations we search in the superclass. This is the case of AbstractControllers: the concrete implementation does not inherit annotations which may have been provided by the superclass



Copyright © 2007 JUG Padova Parancoe Team. All Rights Reserved.