Migrating JavaServer Faces resources in a Web project
The JavaServer Faces support that originally shipped in WebSphere Studio Site Developer V5.1.2 has been updated for Rational Web Developer V6.0. If you want to continue developing in V6.0 Web projects that were created with WebSphere Studio Site Developer V5.1.2, it is recommended that you upgrade the Faces project runtime resources to the latest levels.
Note: If you created JavaServer Pages (JSPs) that contained Faces Client Components, separately migrate the Faces Client Components runtime resources to the latest levels. Refer to Migrating JavaServer Faces resources with Faces Client Components.
If you create or edit JSPs in a project migrated from WebSphere Studio Site Developer V5.1.2, you will be prompted that you can migrate the project runtime resources to the latest levels. Click OK to complete the migration automatically.
Note: If you respond No the first time you are prompted to migrate and intentionally stay with the back-level Java archive (JAR) files, you will not be prompted again. You will need to migrate the project resources manually if you require them in the future. To migrate the JavaServer Faces project resources manually:
- Import your existing Web project with Faces content into a Rational Web Developer V6.0 workspace.
- Create a new Web project (or, if you are working with EGL, a new EGL Web project) and call the project JSF60. You will use this project only as a source for the latest runtime artifacts. It can be deleted after migration is complete.
- In the Project Explorer, right-click on the JSF60 project and select Properties from the menu. Switch to the tab for Web Project Features and select Add Faces Base Components and Add Faces Client Framework.
- If you are working with EGL, create a JSF page file as follows:
This step adds the following files to your project:
- Right-click the WebContent folder of your new EGL Web project.
- Select New > Other > Faces JSP File. If you need help in creating the JSP file, press the F1 key.
- eglintdebug.jar
- eglintdebugsupport.jar
- For each existing Faces project that you want to upgrade, do the following:
- Expand the original project in the Project Explorer to show the files in the WebContent/WEB-INF/lib/ folder. Locate and delete any of the following JAR files in this directory:
- eglintdebug.jar (EGL only)
- eglintdebugsupport.jar (EGL only)
- fda.jar (EGL only)
- fdaj.jar (EGL only)
- jsf-api.jar
- jsf-ibm.jar
- jsf-impl.jar
- odc-jsf.jar
- 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> <property-resolver>com.ibm.faces.databind.SelectItemsPropResolver</property-resolver> </application>- If you are working with EGL, copy the files fda6.jar and fdaj6.jar to your new project and do nothing more with the files fda.jar and fdaj.jar, which are no longer used.
- For any JAR files that you deleted (other than fda.jar and fdaj.jar; refer to the previous step), copy the JAR file of the same name from the WebContent/WEB-INF/lib directory of the JSF60 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 them if the original project did not have a particular JAR file.
- 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>- If your original project used WebSphere Data Objects (WDO) for any data access, perform the following additional steps:
- Create a new temporary Faces JSP file in the original project. (Click File > New > Faces JSP File. Refer to the online help for assistance.)
- Drag a relational record list component from the Data drawer on the palette to the page. Pick any connection and data source and press Finish - the data selected is not important. This process will generate any necessary configuration to continue using WDO in this project.
- Delete the temporary JSP file.
Following these steps will bring an older Web project up to the latest levels of Faces functionality in Rational Web Developer V6.0.
If you are working with EGL, right click on the name of each EGL Web project and click Generate; then, if you are not building the projects automatically, click Project > Build All.
Parent topic
Migrating from WebSphere Studio V5.1, 5.1.1, or 5.1.2