Migrating from JSF 1.2 to JSF 2.0?

I am working with a rather large app written in JSF 1.2. JSF 1.2 is around 6 years old now. I need to upgrade to JSF 2.0. How painful will this be? I noticed that some attributes in custom tags have been changed etc.



Painfulness of upgrading JSF 1.2 to 2.0 depends on the view technology which you are currently using and which you want to use.


JSP 2.x to JSP 2.x = Almost no effort.

Facelets 1.x to Facelets 2.0 = Little effort.

JSP 2.x to Facelets 2.0 = Lot of effort. Double this if you also have custom components.


Basic changes


Regardless of the view technology switch, at least the following steps should be done:


Remove JSF 1.2 JAR's from /WEB-INF/lib (if any).

Drop JSF 2.0 JAR's in /WEB-INF/lib (if JSF 1.2 was servletcontainer-supplied, you might want to change the classloading policy to load webapp libraries first before servletcontainer libraries, see also JSF2 classloading issues in application servers).

Update root declaration of faces-config.xml to comply JSF 2.0 spec.

JSF 2.0 have many new features and components and I don’t feel migration will be painful. Only area you will find difficult is in using thrid party libraries. If your application is heavily dependant upon libraries like Richfaces then you will face problem.