it.openutils.web.spring
Class ParamNameUrlHandlerMapping

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 it.openutils.web.spring.ParamNameUrlHandlerMapping
All Implemented Interfaces:
org.springframework.context.ApplicationContextAware, org.springframework.core.Ordered, org.springframework.web.servlet.HandlerMapping

public class ParamNameUrlHandlerMapping
extends org.springframework.web.servlet.handler.AbstractUrlHandlerMapping

Implementation of the HandlerMapping interface to map from URLs to request handler beans.

Author:
Fabrizio Giustina

Field Summary
 
Fields inherited from class org.springframework.web.servlet.handler.AbstractHandlerMapping
logger
 
Constructor Summary
ParamNameUrlHandlerMapping()
           
 
Method Summary
protected  java.lang.Object getHandlerInternal(javax.servlet.http.HttpServletRequest request)
          Look up a handler for the URL path of the given request.
 void initApplicationContext()
          init the application context
 void setMappings(java.util.Properties mappings)
          Map URL paths to handler bean names.
 void setParamName(java.lang.String paramName)
          set the parameter name
 void setUrlMap(java.util.Map urlMap)
          Set a Map with URL paths as keys and handler beans as values.
 
Methods inherited from class org.springframework.web.servlet.handler.AbstractUrlHandlerMapping
lookupHandler, registerHandler, setAlwaysUseFullPath, setLazyInitHandlers, setPathMatcher, setUrlDecode, setUrlPathHelper
 
Methods inherited from class org.springframework.web.servlet.handler.AbstractHandlerMapping
getDefaultHandler, getHandler, getOrder, setDefaultHandler, setInterceptors, setOrder
 
Methods inherited from class org.springframework.web.context.support.WebApplicationObjectSupport
getServletContext, getTempDir, getWebApplicationContext, isContextRequired
 
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

ParamNameUrlHandlerMapping

public ParamNameUrlHandlerMapping()
Method Detail

setUrlMap

public void setUrlMap(java.util.Map urlMap)
Set a Map with URL paths as keys and handler beans as values. Convenient for population with bean references.

Supports direct URL matches and Ant-style pattern matches. For syntax details, see the PathMatcher class.

Parameters:
urlMap - map with URLs as keys and beans as values
See Also:
PathMatcher

setParamName

public void setParamName(java.lang.String paramName)
set the parameter name

Parameters:
paramName -

setMappings

public void setMappings(java.util.Properties mappings)
Map URL paths to handler bean names. This the typical way of configuring this HandlerMapping.

Supports direct URL matches and Ant-style pattern matches. For syntax details, see the PathMatcher class.

Parameters:
mappings - properties with URLs as keys and bean names as values
See Also:
PathMatcher

initApplicationContext

public void initApplicationContext()
                            throws org.springframework.beans.BeansException
init the application context

Overrides:
initApplicationContext in class org.springframework.context.support.ApplicationObjectSupport
Throws:
org.springframework.beans.BeansException
See Also:
ApplicationObjectSupport.initApplicationContext()

getHandlerInternal

protected java.lang.Object getHandlerInternal(javax.servlet.http.HttpServletRequest request)
                                       throws java.lang.Exception
Look up a handler for the URL path of the given request.

Overrides:
getHandlerInternal in class org.springframework.web.servlet.handler.AbstractUrlHandlerMapping
Parameters:
request - current HTTP request
Returns:
the looked up handler instance, or null
Throws:
java.lang.Exception


Copyright {inceptionYear}-2006 Fabrizio Giustina. All Rights Reserved.