public interface

HandlerAdapter

org.springframework.web.portlet.HandlerAdapter
Known Indirect Subclasses

Class Overview

Portlet MVC framework SPI interface, allowing parameterization of core MVC workflow.

Interface that must be implemented for each handler type to handle a request. This interface is used to allow the DispatcherPortlet to be indefinitely extensible. The DispatcherPortlet accesses all installed handlers through this interface, meaning that it does not contain code specific to any handler type.

Note that a handler can be of type Object. This is to enable handlers from other frameworks to be integrated with this framework without custom coding.

This interface is not intended for application developers. It is available to handlers who want to develop their own web workflow.

Note: Implementations can implement the Ordered interface to be able to specify a sorting order and thus a priority for getting applied by DispatcherPortlet. Non-Ordered instances get treated as lowest priority.

Summary

Public Methods
abstract void handleAction(ActionRequest request, ActionResponse response, Object handler)
Use the given handler to handle this action request.
abstract void handleEvent(EventRequest request, EventResponse response, Object handler)
Use the given handler to handle this event request.
abstract ModelAndView handleRender(RenderRequest request, RenderResponse response, Object handler)
Use the given handler to handle this render request.
abstract ModelAndView handleResource(ResourceRequest request, ResourceResponse response, Object handler)
Use the given handler to handle this resource request.
abstract boolean supports(Object handler)
Given a handler instance, return whether or not this HandlerAdapter can support it.

Public Methods

public abstract 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 in case of errors
See Also
  • javax.portlet.Portlet#processAction

public abstract 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 in case of errors
See Also
  • javax.portlet.EventPortlet#processEvent

public abstract 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 in case of errors
See Also
  • javax.portlet.Portlet#render

public abstract 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 in case of errors
See Also
  • javax.portlet.ResourceServingPortlet#serveResource

public abstract 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