Add the following to your web-inf / lib file:
JSF-api-2.0.9.jar JSF-Facelets-1.1.14.jar JSF-osusch-2.0.4-b09.jar JSTL-1.2.jar
without jsf-facelets * .jar, you cannot display the jsf view.
And, following the example of your web.xml:
<servlet> <servlet-name>Faces Servlet</servlet-name> <servlet-class>javax.faces.webapp.FacesServlet</servlet-class> <load-on-startup>1</load-on-startup> </servlet> <servlet-mapping> <servlet-name>Faces Servlet</servlet-name> <url-pattern>/jsf/*</url-pattern> <url-pattern>*.xhtml</url-pattern> </servlet-mapping>
Without more than two url templates, tomcat will not be able to display the .xhtml file correctly.
And, faces-config.xml:
<?xml version="1.0" encoding="UTF-8"?> <faces-config xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-facesconfig_2_0.xsd" version="2.0"> </faces-config>
source share