How to run JSF 2.x in Jboss AS 5.1

I have new project run on Jboss AS 5.1.0.GA using JSF 2.1.10 and RichFaces 4.2.2 final.
I try to search the solution on Google I found “Stinky Cheese” article “JBoss 5 with JSF 2 on a per-app basis” this is very usefull.

1. Add the following three things to web.xml

<!-- JSF 2: this tells JBoss 5 to use the jsf jars included in the app -->
<context-param>
   <param-name>org.jboss.jbossfaces.WAR_BUNDLES_JSF_IMPL</param-name>
   <param-value>true</param-value>
</context-param>

<!-- JSF 2: this needs to be included to avoid an error message -->
<context-param>
   <param-name>com.sun.faces.injectionProvider</param-name>
   <param-value>org.jboss.web.jsf.integration.injection.JBossInjectionProvider</param-value>
</context-param>

<!-- JSF 2: use pages named .xhtml instead of .jsp. -->
<context-param>
   <param-name>javax.faces.DEFAULT_SUFFIX</param-name>
   <param-value>.xhtml</param-value>
</context-param>

2. Download Jboss AS 6.1
3. Copy the following jars from JBoss 6.1 into the WEB-INF\lib directory.

<Jboss6.1>\common\lib\jboss-mc-int-servlet.jar
<Jboss6.1 6>server\default\deployers\jsf.deployer\Mojarra-2.0\jsf-libs\jboss-faces.jar

4. Add following jar to WEB-INF\lib directory.(If not exists on you application)

	el-api-2.2.jar
	el-impl-2.2.jar
	jsp-api-2.1.jar

Application environments
1. Jboss AS 5.1.0.GA
2. JDK 1.6
3. RichFaces 4.2.2
4. JSF 2.1.10

Reference
JBoss 5 with JSF 2 on a per-app basis

  1. No comments yet.

  1. No trackbacks yet.