Using two-phase rendering with JSR 286 portlets
For portlets conforming to JSR 286, HCL Digital Experience includes support for two-phase rendering, which allows portlets to set cookies and the HTTP headers and to change the portal page title dynamically.
- Enabling two-phase rendering for a portlet
By default, two-phase rendering is turned off. To enable two-phase rendering for a portlet, you must update theportlet.xml
deployment descriptor for the portlet. - Setting headers for a JSR 286 portlet
To set HTTP header information in your JSR 286 portlet, use the setProperty and addProperty methods of the PortletResponse. - Setting 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. - Modifying the HTML head section of a JSR 286 portlet
To write into the HTML head section of your JSR 286 portlet, for example, to change a page title, use theaddProperty
method on thePortletResponse
. - Setting portlet caching values for a JSR 286 portlet
You can dynamically modify portlet caching parameters for a JSR 286 portlet during the render phase.