Using RichFaces with JBoss AS 5.x - 6
In this short tutorial we will show how easily you can get started with Richfaces 3.3 using the latest JBoss distribution. Tested on JBoss 5.1.0 and 6.0.0
We have already published a tutorial about Richfaces 3.2 running on JBoss 4.X
You are adviced to read this tutorial at first if you don't have any notion about RichFaces, otherwise just go on reading.
Let's divide the installation in a few steps:
Unpack the archive in a folder of your preference.
We have already published a tutorial about Richfaces 3.2 running on JBoss 4.X
You are adviced to read this tutorial at first if you don't have any notion about RichFaces, otherwise just go on reading.
Let's divide the installation in a few steps:
Step 1 download richfaces latest stable release
http://www.jboss.org/richfaces/download/stable.htmlUnpack the archive in a folder of your preference.
Step 2 Create a new Web Project from your favourite IDE
A Richfaces Web application needs of course a Web project.

Once created you need to add a set of libraries to your Web Project.
JBoss Tools has a plugin specific for Rich Faces. This can speed up your Project creation by adding the required configuration files to your project. Check on http://www.jboss.org/tools
Step 3 Add libraries to your Web Project
A Richfaces project needs a set of core libraries plus a few dependancies which needs to be downloaded. Here's the list of libraries which need to be included in your project:| Library | Location |
| richfaces-api-3.3.2.SR1.jar | lib folder of your RichFaces distribution |
| richfaces-impl-3.3.2.SR1.jar | lib folder of your RichFaces distribution |
| richfaces-ui-3.3.2.SR1.jar | lib folder of your RichFaces distribution |
| commons-beanutils-1.7.0.jar | http://archive.apache.org/dist/commons/beanutils/binaries/ |
| commons-digester-1.8.jar | http://archive.apache.org/dist/commons/digester/binaries/ |
| jhighlight-1.0.jar | http://nixbit.com/cat/text-editingprocessing/markup/jhighlight/ |
Step 4 Configure web.xml to load Richfaces libs.
Configure your Web application's web.xml to use JSF Servlet and Richfaces filters. Copy and paste the following XML in your web.xmlStep 5 Create a sample application
The configuration is completed. Now let's add a simple JSP and a JSF Managed bean to verify that your environment has been correclty installed.
Add a page named index.jsp to your project:
This JSP page contains a Backing Bean named UserBean which needs to be added to your Project as Class and then declared in the faces-config.xml configuration file.
Here's the bean.UserBean Class:
And finally this is the faces-config.xml file which contains the JSF Bean declaration:
At this point your Project is ready to run. We include a snapshot of how the Project Explorer should look like :

Now run your application by pointing to your index.jsp page:
http://localhost:8080/SampleRich/index.jsf


