Use two-phase rendering with JSR 286 portlets
For portlets conforming to JSR 286, IBM WebSphere Portal includes support for two-phase rendering, which allows portlets to set cookies and the HTTP headers and to change the portal page title dynamically.
- Enable two-phase rendering for a portlet
By default, two-phase rendering is turned off. To enable two-phase rendering for a portlet, update the portlet.xml deployment descriptors for the portlet.- Set headers for a JSR 286 portlet
To set HTTP header information in the JSR 286 portlet, use the setProperty and addProperty methods of the PortletResponse.- Set cookies for a JSR 286 portlet
Although cookies can be set like any other HTTP header, the portlet API provides the addProperty convenience method on the PortletResponse for setting cookies.- Modify the HTML head section of a JSR 286 portlet
To write into the HTML head section of the JSR 286 portlet, for example, to change a page title, use the addProperty method on the PortletResponse.- Set portlet caching values for a JSR 286 portlet
We can dynamically modify portlet caching parameters for a JSR 286 portlet during the render phase.
Parent: Standard portlet API
Related reference:
WSRP two-phase rendering