类 PortletModeHandlerMapping
- java.lang.Object
- org.springframework.context.support.ApplicationObjectSupport
- org.springframework.web.portlet.handler.AbstractHandlerMapping
- org.springframework.web.portlet.handler.AbstractMapBasedHandlerMapping<PortletMode>
- org.springframework.web.portlet.handler.PortletModeHandlerMapping
- 所有已实现的接口:
Aware
,ApplicationContextAware
,Ordered
,HandlerMapping
public class PortletModeHandlerMapping extends AbstractMapBasedHandlerMapping<PortletMode>
Implementation of theHandlerMapping
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>
- 从以下版本开始:
- 2.0
- 作者:
- William G. Thompson, Jr., John A. Lewis
嵌套类概要
从类继承的嵌套类/接口 org.springframework.web.portlet.handler.AbstractMapBasedHandlerMapping
AbstractMapBasedHandlerMapping.PortletRequestMappingPredicate
字段概要
从类继承的字段 org.springframework.context.support.ApplicationObjectSupport
logger
从接口继承的字段 org.springframework.core.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
构造器概要
构造器 构造器 说明 PortletModeHandlerMapping()
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 protected PortletMode
getLookupKey(PortletRequest request)
Uses the current PortletMode as lookup key.void
initApplicationContext()
Calls theregisterHandlers
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.从类继承的方法 org.springframework.web.portlet.handler.AbstractMapBasedHandlerMapping
getHandlerInternal, registerHandler, registerHandler, registerHandlers, setLazyInitHandlers
从类继承的方法 org.springframework.web.portlet.handler.AbstractHandlerMapping
adaptInterceptor, extendInterceptors, getAdaptedInterceptors, getDefaultHandler, getHandler, getHandlerExecutionChain, getOrder, initInterceptors, setApplyWebRequestInterceptorsToRenderPhaseOnly, setDefaultHandler, setInterceptors, setOrder
从类继承的方法 org.springframework.context.support.ApplicationObjectSupport
getApplicationContext, getMessageSourceAccessor, initApplicationContext, isContextRequired, requiredContextClass, setApplicationContext
构造器详细资料
PortletModeHandlerMapping
public PortletModeHandlerMapping()
方法详细资料
setMappings
public void setMappings(Properties mappings)
Set PortletMode to handler bean name mappings from a Properties object.- 参数:
mappings
- properties with PortletMode names as keys and bean names as values
setPortletModeMap
public void setPortletModeMap(Map<String,?> portletModeMap)
Set a Map with PortletModes as keys and handler beans as values. Convenient for population with bean references.- 参数:
portletModeMap
- map with PortletMode names as keys and beans or bean names as values
initApplicationContext
public void initApplicationContext() throws BeansException
Calls theregisterHandlers
method in addition to the superclass's initialization.- 覆盖:
initApplicationContext
在类中AbstractHandlerMapping
- 抛出:
ApplicationContextException
- in case of initialization errorsBeansException
- if thrown by ApplicationContext methods- 另请参阅:
AbstractMapBasedHandlerMapping.registerHandlers(java.util.Map<K, ?>)
registerHandlersByMode
protected void registerHandlersByMode(Map<String,Object> portletModeMap)
Register all handlers specified in the Portlet mode map for the corresponding modes.- 参数:
portletModeMap
- Map with mode names as keys and handler beans or bean names as values
getLookupKey
protected PortletMode getLookupKey(PortletRequest request) throws Exception
Uses the current PortletMode as lookup key.- 指定者:
getLookupKey
在类中AbstractMapBasedHandlerMapping<PortletMode>
- 参数:
request
- current portlet request- 返回:
- the lookup key (never
null
) - 抛出:
Exception
- if key computation failed