« Generating Excel... | Main | Maven Projects and... »

RichFaces and Glassfish 3.1

I had some trouble after migration from Glassfish V3.0.1 to Glassfish V3.1 with most of my Richfaces applications using RichFaces 3.3.3.Final. 

There are some post how to configure you Web app with RichFaces 3.3 to get running on JEE6. After all I come to the conclusion that there are some facts you should care about. 

 

  1. Use RichFaces 3.3.3.Final  (richfaces-ui-3.3.3.Final.jar, richfaces-impl-3.3.3.Final.jar, richfaces-api-3.3.3.Final)
  2. Use jsf-faclets 1.1.15.B1 (jsf-faclets-1.1.15.B1.jar
  3. add the 'org.ajax4jsf.application.AjaxViewHandler' to your faces-config.xml file

So my Maven Dependencies looking like that:

 

.....		
<dependency>
	<groupId>com.sun.facelets</groupId>
	<artifactId>jsf-facelets</artifactId>
	<version>1.1.15.B1</version>
</dependency>
<!-- RichFaces -->
<dependency>
	<groupId>org.richfaces.ui</groupId>
	<artifactId>richfaces-ui</artifactId>
	<version>3.3.3.Final</version>
</dependency>
<dependency>
	<groupId>org.richfaces.framework</groupId>
	<artifactId>richfaces-impl</artifactId>
	<version>3.3.3.Final</version>
</dependency> 
  .....

 My faces-config.xml :

....
<application>
	<locale-config>
		<default-locale>en</default-locale>
		<supported-locale>en</supported-locale>
	</locale-config>
	<view-handler>com.sun.facelets.FaceletViewHandler</view-handler>		
	<view-handler>org.ajax4jsf.application.AjaxViewHandler</view-handler>
</application>
.....
		 

 in the web.xml I added the following param:

     <context-param> <param-name>javax.faces.DISABLE_FACELET_JSF_VIEWHANDLER</param-name> <param-value>true</param-value> </context-param>  

With this configuration the application runs on Glassfish 2.1 (JEE5) as also on Glassfish 3.1(JEE6)