|
The Spring Framework | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.springframework.context.support.ApplicationObjectSupport
org.springframework.web.portlet.handler.AbstractHandlerMapping
org.springframework.web.portlet.handler.AbstractMapBasedHandlerMapping
org.springframework.web.portlet.handler.PortletModeHandlerMapping
public class PortletModeHandlerMapping
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>
| Field Summary |
|---|
| Fields inherited from class org.springframework.context.support.ApplicationObjectSupport |
|---|
logger |
| Fields inherited from interface org.springframework.core.Ordered |
|---|
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE |
| Constructor Summary | |
|---|---|
PortletModeHandlerMapping()
|
|
| Method Summary | |
|---|---|
protected Object |
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 |
registerHandlers(Map 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 portletModeMap)
Set a Map with PortletModes as keys and handler beans as values. |
| Methods inherited from class org.springframework.web.portlet.handler.AbstractMapBasedHandlerMapping |
|---|
getHandlerInternal, registerHandler, setLazyInitHandlers |
| Methods inherited from class org.springframework.web.portlet.handler.AbstractHandlerMapping |
|---|
adaptInterceptor, extendInterceptors, getAdaptedInterceptors, getDefaultHandler, getHandler, getHandlerExecutionChain, getOrder, initInterceptors, setApplyWebRequestInterceptorsToRenderPhaseOnly, setDefaultHandler, setInterceptors, setOrder |
| Methods inherited from class org.springframework.context.support.ApplicationObjectSupport |
|---|
getApplicationContext, getMessageSourceAccessor, isContextRequired, requiredContextClass, setApplicationContext |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public PortletModeHandlerMapping()
| Method Detail |
|---|
public void setMappings(Properties mappings)
mappings - properties with PortletMode names as keys and bean names as valuespublic void setPortletModeMap(Map portletModeMap)
portletModeMap - map with PortletMode names as keys and beans or bean names as values
public void initApplicationContext()
throws BeansException
registerHandlers method in addition
to the superclass's initialization.
initApplicationContext in class AbstractHandlerMappingApplicationContextException - in case of initialization errors
BeansException - if thrown by ApplicationContext methodsregisterHandlers(java.util.Map)protected void registerHandlers(Map portletModeMap) throws BeansException
registerHandlers in class AbstractMapBasedHandlerMappingportletModeMap - Map with mode names as keys and handler beans or bean names as values
BeansException - if the handler couldn't be registeredprotected Object getLookupKey(PortletRequest request) throws Exception
getLookupKey in class AbstractMapBasedHandlerMappingrequest - current portlet request
null)
Exception - if key computation failed
|
The Spring Framework | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||