RichFaces is an open source framework that greatly enhance JSF including lifecycle, validation, conversion facilities and management of static and dynamic resources. RichFaces components with built-in Ajax support and a highly customizable look-and-feel can be easily incorporated into JSF applications.
In this tutorial we'll see how to develop some rich pages using Eclipse Editor. It's assumed that the readed is already familiar with JSF concepts. So at first download Richfaces from JBoss site:
Setting up your Richfaces application:
The very first things necessary for an application are the libraries so add to your project the following libraries:
As you can see you need 3 kind of libraries: the rich faces libs you have just downloaded, a JSF implementation (in this case we use MyFaces) and some dependancies required by MyFaces.
We're almost done, we need only a few adds on to the web.xml to get it working correclty:
The parameter org.richfaces.SKIN is used to set up your Rich faces skin, in this case we're using the "blueSky" skin which is quite similar to XP style.
The the parameter org.jboss.jbossfaces.WAR_BUNDLES_JSF_IMPL is needed to tell JBoss that your application comes with its own JSF implementation, otherwise JBoss will use the default shipped with the bundled tomcat.
The Servlet Filter "RichFaces Filter" is used to enable Ajax capabilities. The Faces Servlet is nothing new if you are familiar with JSF.
Let's write a sample JSP named test.jsp just to check your environment is ok:
Invoke your jsf using the .faces suffix: http://localhost:8080/YourContext/test.faces
This should produre a rich panel panel with a Login form.
Notice that for the keeping it simple the input fields are not bound to any JSF Beans. However in a real world application you should rather register the input fields with a Bean and add an action for example on the submit button.