Sun Java System Portal Server 7.1 Developer's Guide

Converting JSF-based Applications to JSF Aware Portlets in Portal Server

Follow the procedure to convert JSF-based application to portlets.

ProcedureTo Convert JSF-based Applications to Portlets

  1. Copy jsf-portlet.jar from PortalServer7–base/lib directory to WEB-INF/lib directory of the application.

  2. Add a new deployment descriptor for the portlet by creating a portlet.xml file.

    The portlet.xml file must placed in the WEB-INF directory of the application.

  3. In the portlet.xml file, set the portlet parameter com.sun.faces.portlet.INIT_VIEW to point to the first page of your portlet.

  4. Modify the JSP pages as follows:

    1. Remove the <html>, <head>, and <body> tags.

    2. Modify use of forward and redirect as the new page will replace the existing portal pages.

    3. Remove all the HTML tags and JavaScript calls which are not allowed (as per JSR 168 specification).

  5. (Optional) Set the portlet parameter com.sun.faces.portlet.INIT_EDIT to point to the edit page of your portlet in the portlet.xml file to provide EDIT functionality for the JSF portlet.

  6. (Optional) Set the portlet parameter com.sun.faces.portlet.INIT_HELP to point to the help page of your portlet in the portlet.xml file to provide HTLP functionality for the JSF portlet.

  7. Deploy the WAR file using the psadmin deploy-portlet command. For example, type psadmin deploy-portlet -u amadmin -f passwordfile -v -d dn -p portalID -i instanceID warfile.

  8. Create a new portlet channel and add it to the desired container.