Monday, April 30, 2012

Run JSF 2.0 on Glassfish 2.1.1

You can add JSF 2.0 and Unified EL (EL 2) magic to Glassfish V2.1.1 in 2 ways.

1) If you want to completly replace JSF 1.x with 2.x in your glassfish V2.1.1 installation


a) Remove existing jsf-impl.jar in ${com.sun.aas.installRoot}/lib
b) Add following JSF2 and unified EL jars. i.e. jsf-api-2.1.jar, jsf-impl-2.1.jar,el-api-2.1.jar, el-impl-2.1.jar in in ${com.sun.aas.installRoot}/lib.
c) Add or update classpath-prefix=”${com.sun.aas.installRoot}/lib/jsf-api.jar;${com.sun.aas.installRoot}/lib/jsf-imp.jar;${com.sun.aas.installRoot}/lib/el-api.jar;${com.sun.aas.installRoot}/lib/el-impl.jar” in ${com.sun.aas.installRoot}/domains//config/domain.xml under as an attribute.


2) If you want to keep JSF 1.x as the default implementation on your glassfish instance but want to implement JSF 2.x only on one of your applications


a) Add el-api-2.1.jar, el-impl-2.1.jar in ${com.sun.aas.installRoot}/lib.
b) Include jsf-api-2.1.jar, jsf-impl-2.1.jar in lib directory of your application war.
c) Add add sun-web.xml under /WEB-INF/ directory of your application war with following properties
mojarra2
d) Add or update classpath-prefix=”${com.sun.aas.installRoot}/lib/el-api.jar;${com.sun.aas.installRoot}/lib/el-impl.jar” in ${com.sun.aas.installRoot}/domains//config/domain.xml under as an attribute.
Hope this helps. Enjoy!!!
Note: (This does not work in Glassfish V2.0 or V2.1)


Original file:
http://ocpsoft.org/java/jsf2-java/jsf2-how-to-add-the-magic-of-el-el2-to-jsf/

Also there is another article show the way:

No comments: