Bridge Configuration The 301 specification is aimed at making the developers life as easy as possible with JSF+Portlet development. You will see below that there are minimal settings to getting any JSF web application up and running in the Portal environment.
Core Setup and Configuration
portlet.xml The basic JSR-301 portlet configuration. yourPortletName javax.portlet.faces.GenericFacesPortlet javax.portlet.faces.defaultViewId.view /welcome.xhtml javax.portlet.faces.defaultViewId.edit /jsf/edit.xhtml /jsf/help.xhtml ]]> When preserveActionParams is set to TRUE, the bridge must maintain any request parameters assigned during the portlet's action request. The request parameters are maintained in the"bridge request scope". When this attribute isn't present or is FALSE the action's request parameters are only maintained for the duration of theportlet request scope. javax.portlet.faces.preserveActionParams true ]]>
faces-config.xml The PortletViewHandler ensures that each JSF portlet instance is porperly namespaced. org.jboss.portletbridge.application.PortletViewHandler org.jboss.portletbridge.application.PortletStateManager ...]]>
web.xml ... org.ajax4jsf.VIEW_HANDLERS org.jboss.portletbridge.application.FaceletPortletViewHandler ]]> 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. javax.portlet.faces.renderPolicy ALWAYS_DELEGATE ... ]]>
JSR-301 The Jboss Portlet Bridge can be used with a any compatible implementation ( for example, MyFaces implementation). Simply put the following into web.xml : javax.portlet.faces.BridgeImplClass org.apache.myfaces.portlet.faces.bridge.BridgeImpl ]]>
RichFaces Setup and Configuration Options
web.xml The following configuration is designated for portlets using the RichFaces library. These settings will vary based on your individual needs. See this section of the RichFaces documentation for more details. org.richfaces.LoadStyleStrategy NONE org.richfaces.LoadScriptStrategy NONE ]]> The org.ajax4jsf.RESOURCE_URI_PREFIX configuration cross references a setting in your jboss-portlet.xml file (see below). These settings are required for RichFaces. org.ajax4jsf.RESOURCE_URI_PREFIX rfRes Ajax4jsf Filter ajax4jsf org.ajax4jsf.Filter ajax4jsf FacesServlet FORWARD REQUEST INCLUDE ... ]]>
jboss-portlet.xml To avoid scripts loading more than once from different portlet windows you can define additional scripts in jboss-portlet.xml. *Note the "rfRes" URI prefix that is mapped in the web.xml. ajaxPortlet ]]>
Seam Setup and Configuration Options
Configuration The ExceptionHandler is used to clean Seam contexts and transactions after errors. org.jboss.portletbridge.ExceptionHandler org.jboss.portletbridge.SeamExceptionHandlerImpl ]]> Earlier 2.0.x versions of Seam portlets must have the LIFECYCLE_ID set to SEAM_PORTLET in the web.xml. This setting allows the bridge to replace the original Seam phase listener during the faces lifecycle addPhaseListeners. This setting is not needed for Seam portlets version 2.1.x and up. javax.faces.LIFECYCLE_ID SEAM_PORTLET ]]>