Updating Faces runtime resources in a portlet project

The JavaServer Faces runtime resources that originally shipped in WebSphere® Studio Application Developer V5.1.2 have been updated for Rational® Application Developer V6.0.1. If you want to continue development on portlet projects that were created with Portal Toolkit 5.0.2.2 for this previous product version, it is recommended that you update the Faces runtime resources to the latest levels.

In Rational Application Developer V6.0.1, the Faces runtime resource updates happen automatically when a portlet project is imported or a workspace is opened that contains out-of-date resources. After importing a portlet project created with Portal Toolkit 5.0.2.2 for WebSphere Studio Application Developer V5.1.x to Rational Application Developer V6.0.1, you will be prompted to update the Faces runtime resources to the latest levels.

Automatically updating runtime resources

To update the Faces runtime resources automatically for a portlet project:
  1. Import a portlet project containing Faces content from WebSphere Studio Application Developer V5.1.x. The Project Migration window opens.
    Note: If the Project Migration window does not open, your automatic build preference setting is probably disabled. In Project Explorer, right-click your portlet project and select Build > Project; the process of rebuilding a project opens the Project Migration window.
  2. If you have other portlet projects with Faces content in your workspace, check Apply this choice to any other projects that need to be upgraded and all your portlet projects will be updated.
  3. Click one of the following:
    • Yes to complete the update automatically.
    • Later to defer the update. To update runtime resources automatically after selecting Later, you have to close and reopen the portlet project or restart the workbench before rebuilding your portlet project. If you have disabled automatic builds, right-click your portlet project and select Build Project.
    • Never to keep your runtime resources back-level. If you choose Never and intentionally stay with the back-level runtime resources, you will not be prompted again to update them. In the future, you will need to update the runtime resources manually if you require them.
  4. To update the portlet-specific Faces runtime resources, jsf-portlet.jar and jsf-wp.jar, you need to follow the manual update steps below.
Note: If you created Faces JSPs that contained Faces Client components, you must separately update the Faces Client components runtime resources to the latest levels. Refer to Updating Faces Client runtime resources in a Web project.

Manually updating runtime resources

To update the Faces runtime resources manually for a portlet project:
  1. Import your existing portlet project with Faces content into a Rational Application Developer V6.0.1 workspace.
  2. Create a new portlet project named JSFP601 with the Faces portlet option selected in the second page. You will use this project only as a source for the latest runtime resources; it can be deleted after the update is complete.
  3. In the Project Explorer, right-click on the JSFP601 project and select Properties from the menu.
  4. Click Web Project Features and select Add Faces Client Framework for Portlet Project, then click OK.
  5. For each existing Faces project that you want to update, do the following:
    1. In Project Explorer, expand an existing project to show the files in the WebContent/WEB-INF/lib/ folder. Locate and delete any of the following JAR files in this directory:
      • jsf-api.jar
      • jsf-ibm.jar
      • jsf-impl.jar
      • jsf-portlet.jar
      • odc-jsf.jar
    2. Locate and open the file WebContent/WEB-INF/faces-config.xml. Add the following elements into this configuration file if they are not already present:
      	<lifecycle>
      		<phase-listener>com.ibm.faces.webapp.ValueResourcePhaseListener</phase-listener>
      	</lifecycle>
      	
      	<application>
      		<variable-resolver>com.ibm.faces.databind.SelectItemsVarResolver</variable-resolver>
      		<variable-resolver>com.ibm.faces.application.WPPortletVariableResolver</variable-resolver>
      		<property-resolver>com.ibm.faces.databind.SelectItemsPropResolver</property-resolver>
      	</application>
      Note: If your portlet project is using the JSR 168 API, specify com.ibm.faces.application.PortletVariableResolver instead of com.ibm.faces.application.WPPortletVariableResolver.
    3. For any JAR files that you deleted, copy the JAR file of the same name from the WebContent/WEB-INF/lib directory of the JSFP601 project and paste it into your original project in the same location. Some configurations will not require all of these JAR files to be present in the project; do not copy a particular JAR file if it was not in the original project.
      • If your portlet project uses the IBM® portlet API or person link component, copy the jsf-wp.jar file into your original project.
      • If you copy the file odc-jsf.jar, copy the file odc-jsf-portlet.jar as well.
    4. Open the web.xml deployment descriptor in the original project and add the following to the configuration:
      	<context-param>
      		<param-name>com.ibm.ws.jsf.JSP_UPDATE_CHECK</param-name>
      		<param-value>true</param-value>
      	</context-param>
      	<context-param>
      		<param-name>com.ibm.ws.jsf.LOAD_FACES_CONFIG_AT_STARTUP</param-name>
      		<param-value>true</param-value>
      	</context-param>
  6. Delete the JSFP601 portlet project.
Related concepts
Compatibility with WebSphere Studio V5.1.x
Related tasks
Updating Faces runtime resources for Web projects from Rational Application Developer V6.0
Updating Faces runtime resources in a Web project
Updating Faces Client runtime resources in a Web project
Updating Faces runtime resources for portlet projects from Rational Application Developer V6.0
Migrating to the portal tools in Rational Application Developer V6.0
Migrating WebSphere Portal V4.2 portlets to V5.x
Related reference
Debugger changes in V6.0
WDO to SDO migration
EGL reserved words in V6.0
Feedback
(C) Copyright IBM Corporation 2000, 2005. All Rights Reserved.