Saturday, October 22, 2011

Grails with Richfaces 4

One of my favorite development environment is Grails and I have used plain Grails, Grails with Vaadin, and recently Grails with Icefaces. I have also tried Grails with Primefaces.

I wanted to see if I can use Grails with Richfaces and taking the cue from the Primefaces integration, I started with Grails with the JSF2 plugin. After much trial and errors, I finally have Richfaces 4 running with Grails. In this example, I used Grails version 1.3.7.

Steps:
1. Create the application (grails create-app)
2. Move into the new application directory
3. Install the jsf2 plugin (grails install-plugin jsf2)
4. Install the templates so that we can edit the web.xml file (grails install-templates)
5. Copy the following JAR files into the lib directory:
cssparser-0.9.5.jar, guava-r07.jar, richfaces-components-api-4.0.0.Final.jar,
richfaces-components-ui-4.0.0.Final.jar, richfaces-core-api-4.0.0.Final.jar,
richfaces-core-impl-4.0.0.Final.jar, sac-1.3.jar
The richfaces jars comes from the Richfaces4.0.0.Final download and the rest I googled for them.

That's it. You can create the JSF2 Richfaces pages in the grails-app/views directory with the .xhtml extension (it must be facelet based) and you can create the backing beans using the bean creation script (grails create-bean).

BTW, I couldn't get the Richfaces 3.3.3 version to integrate. If anyone manages to do it, please post the steps.

No comments:

Post a Comment