I am a newbie and need a little help. I am trying to do a simple <jsp:forward…> and I keep getting a 404 resource not found. I have added the jsf-facelts.jar file to the lib directory. The project is using Eclipse with My Eclipse Version: 3.4.1
Build id: M20080911-1700 with MyEclipse 2.0.1 running on Tomcat 6.0.18.
My web.xml is:
<?xml version=”1.0″ encoding=”UTF-8″?>
<web-app xmlns=”http://java.sun.com/xml/ns/javaee” xmlns:xsi=”http://www.w3.org/2001/XMLSchema-instance” version=”2.5″ xsi:schemaLocation=”http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd”>
<context-param>
<param-name>javax.faces.DEFAULT_SUFFIX</param-name>
<param-value>.xhtml</param-value>
</context-param>
<servlet>
<servlet-name>Faces Servlet</servlet-name>
<servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
<load-on-startup>0</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>Faces Servlet</servlet-name>
<url-pattern>*.faces</url-pattern>
</servlet-mapping>
<welcome-file-list>
<welcome-file>index.jsp</welcome-file>
</welcome-file-list>
<!–Tomcat 5 Workaround: Listener used to initialize JSF on startup–>
<listener>
<listener-class>com.sun.faces.config.ConfigureListener</listener-class>
</listener>
<!–Tomcat 5 Workaround: Listener implementation to handle web application lifecycle event–>
<listener>
<listener-class>com.sun.faces.application.WebappLifecycleListener</listener-class>
</listener>
</web-app>
My index.jsp is:
<%@ page language=”java” import=”java.util.*” pageEncoding=”ISO-8859-1″%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+”://”+request.getServerName()+”:”+request.getServerPort()+path+”/”;
%>
<!DOCTYPE HTML PUBLIC “-//W3C//DTD HTML 4.01 Transitional//EN”>
<html>
<body>
<jsp:forward page=”/index.faces”></jsp:forward>
</body>
</html>
The index.xhtml is in the same subdirectory as the index.jsp