public class

PortletModeHandlerMapping

extends AbstractMapBasedHandlerMapping<K>
java.lang.Object
   ↳ org.springframework.context.support.ApplicationObjectSupport
     ↳ org.springframework.web.portlet.handler.AbstractHandlerMapping
       ↳ org.springframework.web.portlet.handler.AbstractMapBasedHandlerMapping<K>
         ↳ org.springframework.web.portlet.handler.PortletModeHandlerMapping

Class Overview

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

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

 	<bean id="portletModeHandlerMapping" class="org.springframework.web.portlet.handler.PortletModeHandlerMapping">
 		<property name="portletModeMap">
 			<map>
 				<entry key="view"><ref bean="viewHandler"/></entry>
 				<entry key="edit"><ref bean="editHandler"/></entry>
 				<entry key="help"><ref bean="helpHandler"/></entry>
 			</map>
 		</property>
 	</bean>
 

Summary

[Expand]
Inherited Constants
From interface org.springframework.core.Ordered
[Expand]
Inherited Fields
From class org.springframework.context.support.ApplicationObjectSupport
Public Constructors
PortletModeHandlerMapping()
Public Methods
void initApplicationContext()
Calls the registerHandlers method in addition to the superclass's initialization.
void setMappings(Properties mappings)
Set PortletMode to handler bean name mappings from a Properties object.
void setPortletModeMap(Map<String, ?> portletModeMap)
Set a Map with PortletModes as keys and handler beans as values.
Protected Methods
PortletMode getLookupKey(PortletRequest request)
Uses the current PortletMode as lookup key.
void registerHandlersByMode(Map<StringObject> portletModeMap)
Register all handlers specified in the Portlet mode map for the corresponding modes.
[Expand]
Inherited Methods
From class org.springframework.web.portlet.handler.AbstractMapBasedHandlerMapping
From class org.springframework.web.portlet.handler.AbstractHandlerMapping
From class org.springframework.context.support.ApplicationObjectSupport
From class java.lang.Object
From interface org.springframework.context.ApplicationContextAware
From interface org.springframework.core.Ordered
From interface org.springframework.web.portlet.HandlerMapping

Public Constructors

public PortletModeHandlerMapping ()

Public Methods

public void initApplicationContext ()

Calls the registerHandlers method in addition to the superclass's initialization.

public void setMappings (Properties mappings)

Set PortletMode to handler bean name mappings from a Properties object.

Parameters
mappings properties with PortletMode names as keys and bean names as values

public void setPortletModeMap (Map<String, ?> portletModeMap)

Set a Map with PortletModes as keys and handler beans as values. Convenient for population with bean references.

Parameters
portletModeMap map with PortletMode names as keys and beans or bean names as values

Protected Methods

protected PortletMode getLookupKey (PortletRequest request)

Uses the current PortletMode as lookup key.

Parameters
request current portlet request
Returns
  • the lookup key (never null)
Throws
Exception

protected void registerHandlersByMode (Map<StringObject> portletModeMap)

Register all handlers specified in the Portlet mode map for the corresponding modes.

Parameters
portletModeMap Map with mode names as keys and handler beans or bean names as values