|
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.context.PortletApplicationObjectSupport
org.springframework.web.portlet.handler.PortletContentGenerator
org.springframework.web.portlet.mvc.AbstractController
org.springframework.web.portlet.mvc.PortletWrappingController
public class PortletWrappingController
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>
Field Summary |
---|
Fields inherited from class org.springframework.context.support.ApplicationObjectSupport |
---|
logger |
Constructor Summary | |
---|---|
PortletWrappingController()
|
Method Summary | |
---|---|
void |
afterPropertiesSet()
Invoked by a BeanFactory after it has set all bean properties supplied (and satisfied BeanFactoryAware and ApplicationContextAware). |
void |
destroy()
Invoked by a BeanFactory on destruction of a singleton. |
protected void |
handleActionRequestInternal(ActionRequest request,
ActionResponse response)
Subclasses are meant to override this method if the controller is expected to handle action requests. |
protected ModelAndView |
handleRenderRequestInternal(RenderRequest request,
RenderResponse response)
Subclasses are meant to override this method if the controller is expected to handle render requests. |
void |
setBeanName(String name)
Set the name of the bean in the bean factory that created this bean. |
void |
setInitParameters(Properties 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 through setPortletConfig , if available. |
Methods inherited from class org.springframework.web.portlet.mvc.AbstractController |
---|
handleActionRequest, handleRenderRequest, isRenderWhenMinimized, isSynchronizeOnSession, setRenderWhenMinimized, setSynchronizeOnSession |
Methods inherited from class org.springframework.web.portlet.handler.PortletContentGenerator |
---|
applyCacheSeconds, cacheForSeconds, check, checkAndPrepare, checkAndPrepare, getCacheSeconds, isRequireSession, preventCaching, setCacheSeconds, setRequireSession |
Methods inherited from class org.springframework.web.portlet.context.PortletApplicationObjectSupport |
---|
getPortletContext, getTempDir, isContextRequired |
Methods inherited from class org.springframework.context.support.ApplicationObjectSupport |
---|
getApplicationContext, getMessageSourceAccessor, initApplicationContext, requiredContextClass, setApplicationContext |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public PortletWrappingController()
Method Detail |
---|
public void setUseSharedPortletConfig(boolean useSharedPortletConfig)
setPortletConfig
, 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.
setPortletConfig(javax.portlet.PortletConfig)
public void setPortletContext(PortletContext portletContext)
PortletContextAware
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
in interface PortletContextAware
setPortletContext
in class PortletApplicationObjectSupport
portletContext
- PortletContext object to be used by this objectpublic void setPortletConfig(PortletConfig portletConfig)
PortletConfigAware
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
in interface PortletConfigAware
portletConfig
- PortletConfig object to be used by this objectpublic void setPortletClass(Class portletClass)
javax.portlet.Portlet
.
Portlet
public void setPortletName(String portletName)
public void setInitParameters(Properties initParameters)
public void setBeanName(String name)
BeanNameAware
Invoked after population of normal bean properties but before an init callback like InitializingBean's afterPropertiesSet or a custom init-method.
setBeanName
in interface BeanNameAware
name
- the name of the bean in the factorypublic void afterPropertiesSet() throws Exception
InitializingBean
This method allows the bean instance to perform initialization only possible when all bean properties have been set and to throw an exception in the event of misconfiguration.
afterPropertiesSet
in interface InitializingBean
Exception
- in the event of misconfiguration (such
as failure to set an essential property) or if initialization fails.protected void handleActionRequestInternal(ActionRequest request, ActionResponse response) throws Exception
AbstractController
handleActionRequest
.
The default implementation throws a PortletException.
handleActionRequestInternal
in class AbstractController
Exception
AbstractController.handleActionRequest(javax.portlet.ActionRequest, javax.portlet.ActionResponse)
,
AbstractController.handleRenderRequestInternal(javax.portlet.RenderRequest, javax.portlet.RenderResponse)
protected ModelAndView handleRenderRequestInternal(RenderRequest request, RenderResponse response) throws Exception
AbstractController
handleRenderRequest
.
The default implementation throws a PortletException.
handleRenderRequestInternal
in class AbstractController
Exception
AbstractController.handleRenderRequest(javax.portlet.RenderRequest, javax.portlet.RenderResponse)
,
AbstractController.handleActionRequestInternal(javax.portlet.ActionRequest, javax.portlet.ActionResponse)
public void destroy()
DisposableBean
destroy
in interface DisposableBean
|
The Spring Framework | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |