Developing > Persistence layer > WebSphere Commerce integration with WebSphere Portal > Customizing WebSphere Commerce Portal integration > Use the provided WebSphere Commerce MVCPortlet class (MVC style)
WebSphere Commerce Portal integration event handlers
In WebSphere Commerce portlet programming, you are advised to use generic event handlers.
- A generic action handler, com.ibm.commerce.foundation.client.portal.handlers.MVCPortletActionHandler, calls out to WebSphere Commerce client libraries through configurations specified in the MVC configuration file.
- A generic render handler, com.ibm.commerce.foundation.client.portal.handlers.MVCPortletRenderHandler, returns the proper JSP file path to the portlet container according to the current portlet mode.
This programming pattern greatly reduces code redundancy as well as maintaining a consistent behavior across all WebSphere Commerce portlet actions.
In addition to using these generic handlers, the WebSphere Commerce and WebSphere Portal integration allows you to customize both the action handler and the render handler.
WebSphere Commerce portlet action handler
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.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.
WebSphere Commerce portlet render handler
The WebSphere Commerce Portlet render handler should not call the WebSphere Commerce services. Instead, it simply checks for the current state and mode of the portlet in order to determine the appropriate JSP path to be used when calling the request dispatcher.
Related concepts
WebSphere Commerce integration with WebSphere Portal
Use WebSphere Commerce services in portlets
Populating data on a portlet JSP file using the WebSphere Commerce foundation tag library
WebSphere Commerce Portal integration architecture
WebSphere Commerce portlet action handler
WebSphere Commerce portlet render handlerRelated tasks
Add or customizing a portlet using the MVCPortlet classLast updated: 25 November 2009