public class PortletModeHandlerMapping extends AbstractMapBasedHandlerMapping<PortletMode>
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>
AbstractMapBasedHandlerMapping.PortletRequestMappingPredicate
logger
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
Constructor and Description |
---|
PortletModeHandlerMapping() |
Modifier and Type | Method and Description |
---|---|
protected PortletMode |
getLookupKey(PortletRequest request)
Uses the current PortletMode as lookup key.
|
void |
initApplicationContext()
Calls the
registerHandlers method in addition
to the superclass's initialization. |
protected void |
registerHandlersByMode(Map<String,Object> portletModeMap)
Register all handlers specified in the Portlet mode map for the corresponding modes.
|
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.
|
getHandlerInternal, registerHandler, registerHandler, registerHandlers, setLazyInitHandlers
adaptInterceptor, extendInterceptors, getAdaptedInterceptors, getDefaultHandler, getHandler, getHandlerExecutionChain, getOrder, initInterceptors, setApplyWebRequestInterceptorsToRenderPhaseOnly, setDefaultHandler, setInterceptors, setOrder
getApplicationContext, getMessageSourceAccessor, initApplicationContext, isContextRequired, requiredContextClass, setApplicationContext
public void setMappings(Properties mappings)
mappings
- properties with PortletMode names as keys and bean names as valuespublic void setPortletModeMap(Map<String,?> portletModeMap)
portletModeMap
- map with PortletMode names as keys and beans or bean names as valuespublic void initApplicationContext() throws BeansException
registerHandlers
method in addition
to the superclass's initialization.initApplicationContext
in class AbstractHandlerMapping
ApplicationContextException
- in case of initialization errorsBeansException
- if thrown by ApplicationContext methodsAbstractMapBasedHandlerMapping.registerHandlers(java.util.Map<K, ?>)
protected void registerHandlersByMode(Map<String,Object> portletModeMap)
portletModeMap
- Map with mode names as keys and handler beans or bean names as valuesprotected PortletMode getLookupKey(PortletRequest request) throws Exception
getLookupKey
in class AbstractMapBasedHandlerMapping<PortletMode>
request
- current portlet requestnull
)Exception
- if key computation failed