Develop > Presentation layer > WebSphere Commerce integration with WebSphere Portal > Customize WebSphere Commerce Portal integration > Use the provided WebSphere Commerce MVCPortlet class (MVC style) > WebSphere Commerce Portal integration event handlers
WebSphere Commerce portlet action handler
This WebSphere Commerce portlet 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. It 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.
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. Note that a page refresh issued from the portlet container does not involve performAction().
To create a new customized version of the WebSphere Commerce Portlet action handler, the new code must implement the com.ibm.commerce.foundation.client.portal.handlers.PortletActionHandler interface. A generic portlet action request handler, com.ibm.commerce.foundation.client.portal.handlers.MVCPortletActionHandler, is provided to simplify the task of calling the WebSphere Commerce service client library, which is the recommended programming pattern. See MVCPortletActionHandler for more information.
When coding a new WebSphere Commerce portlet action request handler, be aware of a number of things. There is additional runtime information that needs to be gathered for use with the WebSphere Commerce service client library. When calling a client library, two mandatory objects are required - a business context object and the authentication callback handler. See AuthenticationCallbackHandler for more information.
- Business context object
A BusinessContextType object is used to represent the business contextual information defined for the portlet. This contextual information should be set into this object for synchronizing with WebSphere Commerce services.
- Authentication callback handler object
Regardless of which authentication method the portlet chooses to use, the client library and WebSphere Commerce services should not be aware of the method when interacting with the portlet in the Portal environment. A callback handler is therefore used to generate an identity token for use in calling a WebSphere Commerce service client library.
Related concepts
WebSphere Commerce integration with WebSphere Portal
Use WebSphere Commerce services in portlets
WebSphere Commerce services functional architecture
WebSphere Commerce Portal integration event handlers
Related tasks
Call a WebSphere Commerce service using the MVC portlet configuration file
Related reference