public class MVCPortletActionHandler extends java.lang.Object implements PortletActionHandler
A generic portlet action request handler, com.ibm.commerce.foundation.client.portal.handlers.MVCPortletActionHandler, has been provided to simplify the task of calling the WebSphere Commerce service client library, which is the recommended programming pattern.
This action handler invokes the logic for handling this portlet action request. It retrieves several properties, clientLibrary, clientMethod, renderName, and session, from the MVC configuration registry, and then calls into the client library method provided using Java reflection, passing a parameter map which is composed based on the name-value pairs given in the action request. It is up to the client library to determine what values to take from the parameter map.
When a response is returned by the client library, this handler will take the response name-value pair map (which can either be a map of String[] or a map of String) returned from the client library, and then set to the response object as a render parameter so that the context and core business data will not be lost in an event of a page refresh. A page refresh issued from the portlet container does not involve performAction() and therefore there is a possibility that certain business data is lost as a result of a refresh request.
If an error has occurred during the execution of this method, a PortletException is expected to be thrown - this PortletException is actually a wrapper of the original exception which causes the error condition. The controller, MVCPortlet, will then handle such error condition accordingly.
Constructor and Description |
---|
MVCPortletActionHandler() |
Modifier and Type | Method and Description |
---|---|
void | execute(javax.portlet.Portlet portlet, javax.portlet.ActionRequest actionRequest, javax.portlet.ActionResponse actionResponse)
Invokes the logic for handling the portlet action request.
|
void | executeActionConfiguration(javax.portlet.Portlet portlet, javax.portlet.ActionRequest actionRequest, javax.portlet.ActionResponse actionResponse, com.ibm.commerce.foundation.internal.client.portal.configurations.PortletActionConfiguration portletActionConfiguration)
Execute the action using a given portlet action configuration object.
|
public void execute(javax.portlet.Portlet portlet, javax.portlet.ActionRequest actionRequest, javax.portlet.ActionResponse actionResponse) throws javax.portlet.PortletException
public void executeActionConfiguration(javax.portlet.Portlet portlet, javax.portlet.ActionRequest actionRequest, javax.portlet.ActionResponse actionResponse, com.ibm.commerce.foundation.internal.client.portal.configurations.PortletActionConfiguration portletActionConfiguration) throws javax.portlet.PortletException