- This topic has 4 replies, 2 voices, and was last updated 15 years, 10 months ago by Loyal Water.
-
AuthorPosts
-
gbadavidsonMemberI 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
Loyal WaterMemberIm not sure. Maybe some other users on this forum could help you with this.
gbadavidsonMemberDo you have a simple sample app that does the “forward” to an xhtml file correctly. I downloaded a sample called MyBlog and it when the “.faces” call is made it fails with the same 404 error.
gbadavidsonMemberI want to apologize for taking your time earlier. It seems I had a bit of a brain malfunction….
The problem I discovered was related to Tomcat, specificlly that I had installed tomcat 5.5 and set the Catalina_Home environmental variable for that version. I subsequently loaded Tomcat 6 but did not update the environmental variable. So I found myself in a situation where Tomcat was not operating as expected. When I adjusted the environmental variable the problem ceased to exist.
Loyal WaterMemberGlad you got the issue sorted out.
-
AuthorPosts