Buy anything from HongKong - Dealextreme

You can buy any kind of electronic gadgets from DealExtreme with free shipping option.
Please visit DealExtreme for very low prices.
Here is the link to the site : www.dealextreme.com

25 March 2011

JSF 2.0 Migration Guide

The following document identifies the steps that are required to migrate a web application from JSF 1.2 to JSF 2.0 which uses Richfaces 3.3.x and Spring 3.0

The application will continue using RichFaces 3.3.x baseline with JSF 2.0 support
JSF 2.0 built-in facelet support will not be available(Old facelet library will continue)

Future Enhancements

Upgrade to Richfaces 4.0 with full JSF 2.0 support

Library Upgrades


  • Remove Old EL implementations: el-api.jar el-impl.jar
  • Remove Old JSF implementations: jsf-api-1.2.x.jar and jsf-impl-1.2.x.jar
  • Download Mojarra JSF 2.10 Reference implementation ( http://java.net/projects/javaserverfaces/downloads/download/release%252Fmojarra-2.1.0-FCS-binary.zip )
  • Rename Mojarra libraries to jsf-api-2.1.0.jar and jsf-impl-2.1.0.jar
  • Download EL 2.2.0 Reference Implementation ( http://download.java.net/maven/glassfish/javax/el/el-api/2.2.0-SNAPSHOT/el-api-2.2.0-SNAPSHOT.jar http://download.java.net/maven/glassfish/org/glassfish/web/el-impl/2.2.0-SNAPSHOT/el-impl-2.2.0-SNAPSHOT.jar )
  • Remove RichFaces JSF 1.2 Implementation (richfaces-impl-3.3.3.Final.jar)
  • Add RichFaces JSF 2.0 Implementation (richfaces-impl-jsf2-3.3.3.Final.jar) to web-inf/lib folder
  • Add new Mojarra and EL implemetation libraries to web-inf/lib folder

Web.XML Upgrade
Add the following context parameters to Web.xml

<!-- Activating the Expression Language -->
<context-param>
<param-name>com.sun.faces.expressionFactory</param-name>
<param-value>com.sun.el.ExpressionFactoryImpl</param-value>
</context-param>
<context-param>
<param-name>javax.faces.DISABLE_FACELET_JSF_VIEWHANDLER</param-name>
<param-value>true</param-value>
</context-param>

FacesConfig.XML Upgrade

  • Change file header version to 2.0:

<faces-config xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-facesconfig_2_0.xsd"
version="2.0">

  • Remove message bundle definition in <application> tag

<message-bundle>com.ccc.web.resources.messages</message-bundle>



  • Add new resource bundle definition

<resource-bundle>
<base-name>com.ccc.web.resources.messages</base-name>
<var>msg</var>
</resource-bundle>

  • Application tag should look like this:

<application>
<el-resolver>org.springframework.web.jsf.el.SpringBeanFacesELResolver</el-resolver>
<view-handler>org.ajax4jsf.application.AjaxViewHandler</view-handler>
<resource-bundle>
<base-name>com.ccc.web.resources.messages</base-name>
<var>msgs</var>
</resource-bundle>
<locale-config>
<default-locale>tr</default-locale>
<supported-locale>tr</supported-locale>
<supported-locale>en</supported-locale>
</locale-config>
</application>

Other

  • Update validator messages in messages.properties
  • Check custom components.
  • Check custom validators