类 PortletWrappingController
- java.lang.Object
- org.springframework.context.support.ApplicationObjectSupport
- org.springframework.web.portlet.context.PortletApplicationObjectSupport
- org.springframework.web.portlet.handler.PortletContentGenerator
- org.springframework.web.portlet.mvc.AbstractController
- org.springframework.web.portlet.mvc.PortletWrappingController
- 所有已实现的接口:
Aware
,BeanNameAware
,DisposableBean
,InitializingBean
,ApplicationContextAware
,PortletConfigAware
,PortletContextAware
,Controller
,EventAwareController
,ResourceAwareController
public class PortletWrappingController extends AbstractController implements ResourceAwareController, EventAwareController, BeanNameAware, InitializingBean, DisposableBean, PortletContextAware, PortletConfigAware
Controller
implementation that wraps a portlet instance which it manages internally. Such a wrapped portlet is not known outside of this controller; its entire lifecycle is covered here.Useful to invoke an existing portlet via Spring's dispatching infrastructure, for example to apply Spring
HandlerInterceptors
to its requests.Example:
<bean id="wrappingController" class="org.springframework.web.portlet.mvc.PortletWrappingController"> <property name="portletClass"> <value>org.springframework.web.portlet.sample.HelloWorldPortlet</value> </property> <property name="portletName"> <value>hello-world</value> </property> <property name="initParameters"> <props> <prop key="config">/WEB-INF/hello-world-portlet-config.xml</prop> </props> </property> </bean>
- 从以下版本开始:
- 2.0
- 作者:
- Juergen Hoeller, John A. Lewis
字段概要
从类继承的字段 org.springframework.context.support.ApplicationObjectSupport
logger
构造器概要
构造器 构造器 说明 PortletWrappingController()
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 void
afterPropertiesSet()
Invoked by the containingBeanFactory
after it has set all bean properties and satisfiedBeanFactoryAware
,ApplicationContextAware
etc.void
destroy()
Invoked by the containingBeanFactory
on destruction of a bean.protected void
handleActionRequestInternal(ActionRequest request, ActionResponse response)
Subclasses are meant to override this method if the controller is expected to handle action requests.void
handleEventRequest(EventRequest request, EventResponse response)
Process the event request.protected ModelAndView
handleRenderRequestInternal(RenderRequest request, RenderResponse response)
Subclasses are meant to override this method if the controller is expected to handle render requests.ModelAndView
handleResourceRequest(ResourceRequest request, ResourceResponse response)
Process the resource request and return a ModelAndView object which the DispatcherPortlet will render.void
setBeanName(String name)
Set the name of the bean in the bean factory that created this bean.void
setInitParameters(Map<String,String> initParameters)
Specify init parameters for the portlet to wrap, as name-value pairs.void
setPortletClass(Class<?> portletClass)
Set the class of the Portlet to wrap.void
setPortletConfig(PortletConfig portletConfig)
Set the PortletConfigthat this object runs in.void
setPortletContext(PortletContext portletContext)
Set the PortletContext that this object runs in.void
setPortletName(String portletName)
Set the name of the Portlet to wrap.void
setUseSharedPortletConfig(boolean useSharedPortletConfig)
Set whether to use the shared PortletConfig object passed in throughsetPortletConfig
, if available.从类继承的方法 org.springframework.web.portlet.mvc.AbstractController
handleActionRequest, handleRenderRequest, isRenderWhenMinimized, isSynchronizeOnSession, setRenderWhenMinimized, setSynchronizeOnSession
从类继承的方法 org.springframework.web.portlet.handler.PortletContentGenerator
applyCacheSeconds, cacheForSeconds, check, checkAndPrepare, checkAndPrepare, getCacheSeconds, isRequireSession, preventCaching, setCacheSeconds, setRequireSession
从类继承的方法 org.springframework.web.portlet.context.PortletApplicationObjectSupport
getPortletContext, getTempDir, isContextRequired
从类继承的方法 org.springframework.context.support.ApplicationObjectSupport
getApplicationContext, getMessageSourceAccessor, initApplicationContext, initApplicationContext, requiredContextClass, setApplicationContext
构造器详细资料
PortletWrappingController
public PortletWrappingController()
方法详细资料
setUseSharedPortletConfig
public void setUseSharedPortletConfig(boolean useSharedPortletConfig)
Set whether to use the shared PortletConfig object passed in throughsetPortletConfig
, if available.Default is "true". Turn this setting to "false" to pass in a mock PortletConfig object with the bean name as portlet name, holding the current PortletContext.
setPortletContext
public void setPortletContext(PortletContext portletContext)
从接口复制的说明:PortletContextAware
Set the PortletContext that this object runs in.Invoked after population of normal bean properties but before an init callback like InitializingBean's afterPropertiesSet or a custom init-method. Invoked after ApplicationContextAware's setApplicationContext.
- 指定者:
setPortletContext
在接口中PortletContextAware
- 覆盖:
setPortletContext
在类中PortletApplicationObjectSupport
- 参数:
portletContext
- PortletContext object to be used by this object
setPortletConfig
public void setPortletConfig(PortletConfig portletConfig)
从接口复制的说明:PortletConfigAware
Set the PortletConfigthat this object runs in.Invoked after population of normal bean properties but before an init callback like InitializingBean's afterPropertiesSet or a custom init-method. Invoked after ApplicationContextAware's setApplicationContext.
- 指定者:
setPortletConfig
在接口中PortletConfigAware
- 参数:
portletConfig
- PortletConfig object to be used by this object
setPortletClass
public void setPortletClass(Class<?> portletClass)
Set the class of the Portlet to wrap. Needs to implementjavax.portlet.Portlet
.- 另请参阅:
Portlet
setPortletName
public void setPortletName(String portletName)
Set the name of the Portlet to wrap. Default is the bean name of this controller.
setInitParameters
public void setInitParameters(Map<String,String> initParameters)
Specify init parameters for the portlet to wrap, as name-value pairs.
setBeanName
public void setBeanName(String name)
从接口复制的说明:BeanNameAware
Set the name of the bean in the bean factory that created this bean.Invoked after population of normal bean properties but before an init callback such as
InitializingBean.afterPropertiesSet()
or a custom init-method.- 指定者:
setBeanName
在接口中BeanNameAware
- 参数:
name
- the name of the bean in the factory. Note that this name is the actual bean name used in the factory, which may differ from the originally specified name: in particular for inner bean names, the actual bean name might have been made unique through appending "#..." suffixes. Use theBeanFactoryUtils.originalBeanName(String)
method to extract the original bean name (without suffix), if desired.
afterPropertiesSet
public void afterPropertiesSet() throws Exception
从接口复制的说明:InitializingBean
Invoked by the containingBeanFactory
after it has set all bean properties and satisfiedBeanFactoryAware
,ApplicationContextAware
etc.This method allows the bean instance to perform validation of its overall configuration and final initialization when all bean properties have been set.
- 指定者:
afterPropertiesSet
在接口中InitializingBean
- 抛出:
Exception
- in the event of misconfiguration (such as failure to set an essential property) or if initialization fails for any other reason
handleActionRequestInternal
protected void handleActionRequestInternal(ActionRequest request, ActionResponse response) throws Exception
从类复制的说明:AbstractController
Subclasses are meant to override this method if the controller is expected to handle action requests. The contract is the same as forhandleActionRequest
.The default implementation throws a PortletException.
handleRenderRequestInternal
protected ModelAndView handleRenderRequestInternal(RenderRequest request, RenderResponse response) throws Exception
从类复制的说明:AbstractController
Subclasses are meant to override this method if the controller is expected to handle render requests. The contract is the same as forhandleRenderRequest
.The default implementation throws a PortletException.
handleResourceRequest
public ModelAndView handleResourceRequest(ResourceRequest request, ResourceResponse response) throws Exception
从接口复制的说明:ResourceAwareController
Process the resource request and return a ModelAndView object which the DispatcherPortlet will render. Anull
return value is not an error: It indicates that this object completed request processing itself, thus there is no ModelAndView to render.- 指定者:
handleResourceRequest
在接口中ResourceAwareController
- 参数:
request
- current portlet resource requestresponse
- current portlet resource response- 返回:
- a ModelAndView to render, or null if handled directly
- 抛出:
Exception
- in case of errors
handleEventRequest
public void handleEventRequest(EventRequest request, EventResponse response) throws Exception
从接口复制的说明:EventAwareController
Process the event request. There is nothing to return.- 指定者:
handleEventRequest
在接口中EventAwareController
- 参数:
request
- current portlet event requestresponse
- current portlet event response- 抛出:
Exception
- in case of errors
destroy
public void destroy()
从接口复制的说明:DisposableBean
Invoked by the containingBeanFactory
on destruction of a bean.- 指定者:
destroy
在接口中DisposableBean