Skip to end of metadata
Go to start of metadata

Portlet Configuration

Here is an example portlet.xml to configure a JSF2 portlet:

Only the javax.portlet.faces.defaultViewId.view init-param is mandatory. The edit and help init-param's are only required when your portlet requires the Edit and Help portlet modes.

Portlet 2.0 Schema

To have access to the latest Portlet 2.0 spec features, such as Events and Public Render Parameters, it's important to ensure that your portlet.xml contains the following schema definition:

Preserving Request Parameters outside ActionRequest

By default the Portlet Bridge does not retain any Request Parameters that were received as part of an ActionRequest from the Portal. To ensure that Request Parameters from an ActionRequest are retained in the Bridge Request Scope until a RenderRequest, add the following init-param to portlet.xml:

Render Policy

Different JSF View Declaration Languages require different behavior from the Portlet Bridge when it comes to rendering views. Instructing the Bridge on which policy to use is done using the javax.portlet.faces.RENDER_POLICY context-param in web.xml.

If you're using Facelets:

Include the following in web.xml:

If you're using JSP:

Include the following in web.xml:

Supported Render Policies in Portlet Bridge:

  • ALWAYS_DELEGATE: Indicates the Bridge should not render the view itself but rather always delegate the rendering.
  • NEVER_DELEGATE: Indicates the Bridge should always render the view itself and never delegate.
  • DEFAULT: Directs the Bridge to first delegate the render and if and only if an Exception is thrown then render the view based on its own logic. If the configuration parameter is not present or has an invalid value the Bridge renders using default behavior. I.e. as if DEFAULT is set.

Disable Adding Resources to Portal Page Head

By default Portlet Bridge will add any JSF Resources for your portlet into the <head> section of the portal page the portlet is on, if the portlet container supports marking up the head of a page.

If you don't want any resources from your portlet being added to the <head> section of the portal page, simply add the following context param into web.xml of the portlet:

Prevent Self-Closing Script Tags in Portal Page Head

There may be occasions where you may want to prevent script tags being added to the <head> of the Portal page that are self-closing, ie. <script ... />.

The Portlet Bridge is now able to alter the default behavior to convert a self-closing script tag to something like <script .... > </script> by inserting a blank comment
into the XML Document for the script element to prevent a self-closing tag. Enabling it requires you to add the following context param into web.xml:

Labels:
None
Enter labels to add to this page:
Please wait 
Looking for a label? Just start typing.