GeeCON Prague 2014*
The moose likes JSF and the fly likes JSF2 on Tomcat6 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Java » JSF
Reply locked New topic
Author

JSF2 on Tomcat6

Murali Pen
Greenhorn

Joined: May 23, 2006
Posts: 28
Has anyone tried running JSF2 on Tomcat 6? I tried to do this but running into EL compatibility issues. Tried various combinations but nothing worked. I did the setup and test based on the following post.

http://weblogs.java.net/blog/cayhorstmann/archive/2009/12/29/jsf-20-and-tomcat

If anyone accomplished this, please post the following

1) list of libraries in tomcat lib
2) list of libraries in WEB-INF/lib
3) web.xml configuration

I have the following config and my sample page only displays plain HTML but not any JSF text box fields.

I added the following to tomcat lib

el-api-2.2.jar
el-impl-2.2.jar
jstl-api-1.2.jar
jstl-impl-1.2.jar

I have the following in WEB-INF/lib

jsf-api.jar
jsf-impl.jar
jstl-api-1.2.jar
jstl-impl-1.2.jar
weld-servlet.jar

My web.xml is:

<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
id="WebApp_ID"
version="2.5">
<display-name>JsfTest</display-name>

<context-param>
<param-name>javax.faces.PROJECT_STAGE</param-name>
<param-value>Development</param-value>
</context-param>
<context-param>
<param-name>com.sun.faces.expressionFactory</param-name>
<param-value>com.sun.el.ExpressionFactoryImpl</param-value>
</context-param>

<listener>
<listener-class>org.jboss.weld.environment.servlet.Listener</listener-class>
</listener>

<servlet>
<servlet-name>Faces Servlet</servlet-name>
<servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>Faces Servlet</servlet-name>
<url-pattern>*.faces</url-pattern>
</servlet-mapping>

<welcome-file-list>
<welcome-file>index.xhtml</welcome-file>
</welcome-file-list>

</web-app>

I also have an empty beans.xml in my WEB-INF folder. This is required for Weld.

Anyone, please help.


Murali
SCJP,SCBCD,SCWCD
Devaka Cooray
ExamLab Creator
Saloon Keeper

Joined: Jul 29, 2008
Posts: 3112
    
  42

Please UseOneThreadPerQuestion, and continue the discussion in your other thread.


Author of ExamLab ExamLab - a free SCJP / OCPJP exam simulator
What would SCJP exam questions look like? -- Home -- Twitter -- How to Ask a Question
 
GeeCON Prague 2014
 
subject: JSF2 on Tomcat6