I have the mojarra dependencies for running JSF 2.0 inside a servlet container.
Do you mean that you modified the dependencies of the provided pom as suggested in the comments:
<dependencies>
<dependency>
<groupId>javax.faces</groupId>
<artifactId>jsf-api</artifactId>
<version>2.0</version>
<scope>provided</scope>
</dependency>
<!--
Uncomment these dependencies and comment out the one above to use
a simple servlet container instead of a Java EE Application Server
<dependency>
<groupId>com.sun.faces</groupId>
<artifactId>jsf-api</artifactId>
<version>[2.0.1,)</version>
</dependency>
<dependency>
<groupId>com.sun.faces</groupId>
<artifactId>jsf-impl</artifactId>
<version>[2.0.1,)</version>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
<version>2.5</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>javax.servlet.jsp</groupId>
<artifactId>jsp-api</artifactId>
<version>2.1</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>javax.servlet.jsp.jstl</groupId>
<artifactId>jstl-api</artifactId>
<version>1.2</version>
</dependency>
<dependency>
<groupId>org.glassfish.web</groupId>
<artifactId>jstl-impl</artifactId>
<version>1.2</version>
</dependency>
-->
</dependencies>
Can you confirm this? Actually, showing the modified pom might help.
When i use the "run on server" it always say "Cannot found the javax.faces.web.FacesServlet
I guess you meant javax.faces.webapp.FacesServlet
. It is definitely in the jsf-api.jar
. And putting jsf-api.jar
and jsf-impl.jar
into the WEB-INF/lib
should also work. You're using m2eclipse right?
But when deployed to another tomcat instance(without the mojarra jars) it works fine.
Do you mean outside Eclipse? And without putting the Mojarra jars in Tomcat's lib folder?