JBoss.orgCommunity Documentation

Chapter 2. Bridge Configuration

2.1. Core Setup and Configuration
2.1.1. portlet.xml
2.1.2. faces-config.xml
2.1.3. Facelets Configuration
2.1.4. JSP Only Configuration
2.1.5. JSR-301
2.2. RichFaces Setup and Configuration Options
2.2.1. web.xml
2.2.2. jboss-portlet.xml
2.3. Seam Setup and Configuration Options
2.3.1. 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.

The following web.xml setting is only for Facelets based applications



        <web-app xmlns="http://java.sun.com/xml/ns/j2ee"
                 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                 xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
                 version="2.4">
            ...
            <!-- This is optional parameters for a facelets based application -->
            <context-param>
                <param-name>org.ajax4jsf.VIEW_HANDLERS</param-name>
                <param-value>org.jboss.portletbridge.application.FaceletPortletViewHandler</param-value>
            </context-param>



             <context-param>
                <param-name>javax.portlet.faces.renderPolicy</param-name>
                <param-value>
                    ALWAYS_DELEGATE
                </param-value>
            </context-param>
            ...
        </web-app>

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.



            <context-param>
                <param-name>org.richfaces.LoadStyleStrategy</param-name>
                <param-value>NONE</param-value>
            </context-param>
            <context-param>
                <param-name>org.richfaces.LoadScriptStrategy</param-name>
                <param-value>NONE</param-value>
            </context-param>
            

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.



            <context-param>
                <param-name>org.ajax4jsf.RESOURCE_URI_PREFIX</param-name>
                <param-value>rfRes</param-value>
            </context-param>

            <filter>
                <display-name>Ajax4jsf Filter</display-name>
                <filter-name>ajax4jsf</filter-name>
                <filter-class>org.ajax4jsf.Filter</filter-class>
            </filter>

            <filter-mapping>
                <filter-name>ajax4jsf</filter-name>
                <servlet-name>FacesServlet</servlet-name>
                <dispatcher>FORWARD</dispatcher>
                <dispatcher>REQUEST</dispatcher>
                <dispatcher>INCLUDE</dispatcher>
            </filter-mapping>
            ...
        </web-app>