JBoss Community Archive (Read Only)

Portlet Bridge 3.3

portlet.xml

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

<portlet-class>
  javax.portlet.faces.GenericFacesPortlet
</portlet-class>

<init-param>
  <name>javax.portlet.faces.defaultViewId.view</name>
  <value>/welcome.xhtml</value>
</init-param>

<init-param>
  <name>javax.portlet.faces.defaultViewId.edit</name>
  <value>/jsf/edit.xhtml</value>
</init-param>

<init-param>
  <name>javax.portlet.faces.defaultViewId.help</name>
  <value>/jsf/help.xhtml</value>
</init-param>

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:

<portlet-app xmlns="http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd"
  version="2.0"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd">

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:

<init-param>
  <name>javax.portlet.faces.preserveActionParams</name>
  <value>true</value>
</init-param>
JBoss.org Content Archive (Read Only), exported from JBoss Community Documentation Editor at 2020-03-11 12:28:52 UTC, last content change 2012-12-04 16:38:18 UTC.