public class

SimpleControllerHandlerAdapter

extends Object
implements HandlerAdapter PortletContextAware
java.lang.Object
   ↳ org.springframework.web.portlet.mvc.SimpleControllerHandlerAdapter

Class Overview

Adapter to use the Controller workflow interface with the generic DispatcherPortlet.

This is an SPI class, not used directly by application code.

Summary

Public Constructors
SimpleControllerHandlerAdapter()
Public Methods
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.
[Expand]
Inherited Methods
From class java.lang.Object
From interface org.springframework.web.portlet.HandlerAdapter
From interface org.springframework.web.portlet.context.PortletContextAware

Public Constructors

public SimpleControllerHandlerAdapter ()

Public Methods

public void handleAction (ActionRequest request, ActionResponse response, Object handler)

Use the given handler to handle this action request. The workflow that is required may vary widely.

Parameters
request current action request
response current action response
handler handler to use. This object must have previously been passed to the supports method of this interface, which must have returned true.
Throws
Exception

public void handleEvent (EventRequest request, EventResponse response, Object handler)

Use the given handler to handle this event request. The workflow that is required may vary widely.

Parameters
request current action request
response current action response
handler handler to use. This object must have previously been passed to the supports method of this interface, which must have returned true.
Throws
Exception

public ModelAndView handleRender (RenderRequest request, RenderResponse response, Object handler)

Use the given handler to handle this render request. The workflow that is required may vary widely.

Parameters
request current render request
response current render response
handler handler to use. This object must have previously been passed to the supports method of this interface, which must have returned true.
Returns
  • ModelAndView object with the name of the view and the required model data, or null if the request has been handled directly
Throws
Exception

public ModelAndView handleResource (ResourceRequest request, ResourceResponse response, Object handler)

Use the given handler to handle this resource request. The workflow that is required may vary widely.

Parameters
request current render request
response current render response
handler handler to use. This object must have previously been passed to the supports method of this interface, which must have returned true.
Returns
  • ModelAndView object with the name of the view and the required model data, or null if the request has been handled directly
Throws
Exception

public void setPortletContext (PortletContext portletContext)

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.

Parameters
portletContext PortletContext object to be used by this object

public boolean supports (Object handler)

Given a handler instance, return whether or not this HandlerAdapter can support it. Typical HandlerAdapters will base the decision on the handler type. HandlerAdapters will usually only support one handler type each.

A typical implementation:

return (handler instanceof MyHandler);

Parameters
handler handler object to check
Returns
  • whether or not this object can use the given handler