|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.springframework.web.portlet.handler.SimplePortletHandlerAdapter
public class SimplePortletHandlerAdapter
Adapter to use the Portlet interface with the generic DispatcherPortlet.
Calls the Portlet's render and processAction
methods to handle a request.
This adapter is not activated by default; it needs to be defined as a bean in the DispatcherPortlet context. It will automatically apply to mapped handler beans that implement the Portlet interface then.
Note that Portlet instances defined as bean will not receive initialization and destruction callbacks, unless a special post-processor such as SimplePortletPostProcessor is defined in the DispatcherPortlet context.
Alternatively, consider wrapping a Portlet with Spring's PortletWrappingController. This is particularly appropriate for existing Portlet classes, allowing to specify Portlet initialization parameters, etc.
Portlet,
SimplePortletPostProcessor,
PortletWrappingController| Constructor Summary | |
|---|---|
SimplePortletHandlerAdapter()
|
|
| Method Summary | |
|---|---|
void |
handleAction(ActionRequest request,
ActionResponse response,
Object handler)
Use the given handler to handle this action request. |
void |
handleEvent(EventRequest request,
EventResponse response,
Object handler)
Use the given handler to handle this event request. |
ModelAndView |
handleRender(RenderRequest request,
RenderResponse response,
Object handler)
Use the given handler to handle this render request. |
ModelAndView |
handleResource(ResourceRequest request,
ResourceResponse response,
Object handler)
Use the given handler to handle this resource request. |
void |
setPortletContext(PortletContext portletContext)
Set the PortletContext that this object runs in. |
boolean |
supports(Object handler)
Given a handler instance, return whether or not this HandlerAdapter can support it. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public SimplePortletHandlerAdapter()
| Method Detail |
|---|
public void setPortletContext(PortletContext portletContext)
PortletContextAwareInvoked 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 PortletContextAwareportletContext - PortletContext object to be used by this objectpublic boolean supports(Object handler)
HandlerAdapterA typical implementation:
return (handler instanceof MyHandler);
supports in interface HandlerAdapterhandler - handler object to check
public void handleAction(ActionRequest request,
ActionResponse response,
Object handler)
throws Exception
HandlerAdapter
handleAction in interface HandlerAdapterrequest - current action requestresponse - current action responsehandler - handler to use. This object must have previously been passed
to the supports method of this interface, which must have
returned true.
Exception - in case of errorsPortlet.processAction(javax.portlet.ActionRequest, javax.portlet.ActionResponse)
public ModelAndView handleRender(RenderRequest request,
RenderResponse response,
Object handler)
throws Exception
HandlerAdapter
handleRender in interface HandlerAdapterrequest - current render requestresponse - current render responsehandler - handler to use. This object must have previously been passed
to the supports method of this interface, which must have
returned true.
null if the request has been handled directly
Exception - in case of errorsPortlet.render(javax.portlet.RenderRequest, javax.portlet.RenderResponse)
public ModelAndView handleResource(ResourceRequest request,
ResourceResponse response,
Object handler)
throws Exception
HandlerAdapter
handleResource in interface HandlerAdapterrequest - current render requestresponse - current render responsehandler - handler to use. This object must have previously been passed
to the supports method of this interface, which must have
returned true.
null if the request has been handled directly
Exception - in case of errorsResourceServingPortlet.serveResource(javax.portlet.ResourceRequest, javax.portlet.ResourceResponse)
public void handleEvent(EventRequest request,
EventResponse response,
Object handler)
throws Exception
HandlerAdapter
handleEvent in interface HandlerAdapterrequest - current action requestresponse - current action responsehandler - handler to use. This object must have previously been passed
to the supports method of this interface, which must have
returned true.
Exception - in case of errorsEventPortlet.processEvent(javax.portlet.EventRequest, javax.portlet.EventResponse)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||