Author
HTTP Status 404 - /Ch03/
Hui Zhao
Ranch Hand
Joined: Jul 09, 2007
Posts: 116
posted Feb 13, 2008 13:31:00
0
Hi, I am debugging a simple JSP example but I failed. J2ee 1.4;j2se 6;Tomcat 6.0.10 Here is the directory structure url http://localhost:80/Ch03 welcome.jsp web.xml in C:\apache-tomcat-6.0.10\webapps\ROOT\WEB-INF\Ch03\WEB-INF I have spent three days still not figured it out. Could you please help me? Thanks for any hint.
Bear Bibeault
Author and ninkuma
Marshal
Joined: Jan 10, 2002
Posts: 56152
Why are you putting a web app inside the WEB-INF of another web app? Place your web app in the webapps folder.
[Smart Questions ] [JSP FAQ ] [Books by Bear ] [Bear's FrontMan ] [About Bear ]
Hui Zhao
Ranch Hand
Joined: Jul 09, 2007
Posts: 116
posted Feb 13, 2008 14:41:00
0
I place it in It is still wrong.
Bear Bibeault
Author and ninkuma
Marshal
Joined: Jan 10, 2002
Posts: 56152
DON'T put it in the WEB-INF folder. Put it in webapps.
Hui Zhao
Ranch Hand
Joined: Jul 09, 2007
Posts: 116
posted Feb 13, 2008 15:02:00
0
It is placed in Still wrong. Is my web.xml right? Or classpath wrong? Thanks
Hongli Li
Ranch Hand
Joined: Oct 29, 2006
Posts: 124
you class file is not in a package, you jsp page import Ch3.*; but the class file in WEB-INF/class doesnt have a CH3 folder make sure you use package for all you class
Do you know why this cup is useful? Because it is empty.
Ben Souther
Sheriff
Joined: Dec 11, 2004
Posts: 13410
Try this. Go to our CodeBarn , click to the servlets section, download SimpleServlet.war to your webapps directory. Then, go to http://localhost:8080/SimpleServlet. If that works, then you have a properly formatted web application with a deployment descriptor. You can compare this to your application and see where you might have gone wrong.
Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
Hui Zhao
Ranch Hand
Joined: Jul 09, 2007
Posts: 116
posted Feb 13, 2008 19:30:00
0
Ben Souther's servlet does work. But I still get the error type Exception report message description The server encountered an internal error () that prevented it from fulfilling this request. or welcome.jsp Thanks again.
Hongli Li
Ranch Hand
Joined: Oct 29, 2006
Posts: 124
change <%@ page errorPage="/WEB-INF/errorPage.jsp" import="java.util.Iterator,Ch03.FaqCategories" %> to <%@ page errorPage="/WEB-INF/errorPage.jsp" %> <%@ page import="java.util.Iterator,Ch03.FaqCategories" %> try not add any business logic in your jsp, good design only uses JSp as a presentation layer.
Hui Zhao
Ranch Hand
Joined: Jul 09, 2007
Posts: 116
posted Feb 14, 2008 07:41:00
0
Thanks for youe help, I have resloved it. Just change two lines to one line.
subject: HTTP Status 404 - /Ch03/