+

Search Tips   |   Advanced Search

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.

Specify the appropriate method, depending on whether to overwrite or append key values.

When setting headers in the render lifecycle phase, portlets should set the header in the render headers part or simply override the GenericPortlet.doHeaders method to make sure the server's response headers have not already been committed. Note, howeverthat the delivery of HTTP headers to the client cannot be guaranteed, because other portlets on a page might override it or the setting of some header attributes might be against the portal's policy.


Parent: Use two-phase rendering with JSR 286 portlets