Save This Page
Home » spring-framework-2.5.4 » org.springframework » web » portlet » handler » [javadoc | source]
org.springframework.web.portlet.handler
public class: ParameterHandlerMapping [javadoc | source]
java.lang.Object
   org.springframework.context.support.ApplicationObjectSupport
      org.springframework.web.portlet.handler.AbstractHandlerMapping
         org.springframework.web.portlet.handler.AbstractMapBasedHandlerMapping
            org.springframework.web.portlet.handler.ParameterHandlerMapping

All Implemented Interfaces:
    HandlerMapping, Ordered, ApplicationContextAware

Implementation of the org.springframework.web.portlet.HandlerMapping to map from a request parameter to request handler beans.

The default name of the parameter is "action", but can be changed using setParameterName() .

The bean configuration for this mapping will look somthing like this:

<bean id="parameterHandlerMapping" class="org.springframework.web.portlet.handler.ParameterHandlerMapping">
<property name="parameterMap">
<map>
<entry key="add"><ref bean="addItemHandler"/></entry>
<entry key="edit"><ref bean="editItemHandler"/></entry>
<entry key="delete"><ref bean="deleteItemHandler"/></entry>
</map>
</property>
</bean>
Thanks to Rainer Schmitz for suggesting this mapping strategy!
Field Summary
public static final  String DEFAULT_PARAMETER_NAME    Default request parameter name to use for mapping to handlers: "action". 
Fields inherited from org.springframework.context.support.ApplicationObjectSupport:
logger
Method from org.springframework.web.portlet.handler.ParameterHandlerMapping Summary:
getLookupKey,   initApplicationContext,   registerHandlers,   setParameterMap,   setParameterName
Methods from org.springframework.web.portlet.handler.AbstractMapBasedHandlerMapping:
getHandlerInternal,   getLookupKey,   registerHandler,   registerHandler,   registerHandlers,   setLazyInitHandlers
Methods from org.springframework.web.portlet.handler.AbstractHandlerMapping:
adaptInterceptor,   extendInterceptors,   getAdaptedInterceptors,   getDefaultHandler,   getHandler,   getHandlerExecutionChain,   getHandlerInternal,   getOrder,   initApplicationContext,   initInterceptors,   setApplyWebRequestInterceptorsToRenderPhaseOnly,   setDefaultHandler,   setInterceptors,   setOrder
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.portlet.handler.ParameterHandlerMapping Detail:
 protected Object getLookupKey(PortletRequest request) throws Exception 
    Uses the value of the specified parameter as lookup key.
 public  void initApplicationContext() throws BeansException 
    Calls the registerHandlers method in addition to the superclass's initialization.
 protected  void registerHandlers(Map parameterMap) throws BeansException 
    Register all handlers specified in the Portlet mode map for the corresponding modes.
 public  void setParameterMap(Map parameterMap) 
    Set a Map with parameters as keys and handler beans or bean names as values. Convenient for population with bean references.
 public  void setParameterName(String parameterName) 
    Set the name of the parameter used for mapping to handlers.

    Default is "action".