Thursday, April 29, 2010

Migrate from JSF 1.1 to JSF 1.2

Sometimes there is a problem faced by upgrading the version of your JSF in a Dynamic Web Project. After you create a JSF 1.1 project, later it maybe impossible to change it to JSF 1.2 without recreating the project. In fact, a message comes in Eclipse or RSA.
"Cannot change version of project facet Java Server Faces to 1.2"
So, we need to manually modify the project properties. Firstly, below i will give the faces-config.xml for JSF 1.2:



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_1_2.xsd"
version="1.2">



After that we need to go to the .settings folder inside our Eclipse project. Inside this folder we need to open the file: org.eclipse.wst.common.project.facet.core.xml.
" ./settings/org.eclipse.wst.common.project.facet.core.xml "
Find the line: < installed facet="jst.jsf" version="1.1" />
and change it to: < installed facet="jst.jsf" version="1.2" />

That's all. Now you can run your project as a JSF1.2 project.

No comments:

Post a Comment