aspose file tools*
The moose likes JSP and the fly likes HTTP Status 404 - /Ch03/ Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "HTTP Status 404 - /Ch03/" Watch "HTTP Status 404 - /Ch03/" New topic
Author

HTTP Status 404 - /Ch03/

Hui Zhao
Ranch Hand

Joined: Jul 09, 2007
Posts: 116
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: 61216
    
  66

Why are you putting a web app inside the WEB-INF of another web app?

Place your web app in the webapps folder.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Hui Zhao
Ranch Hand

Joined: Jul 09, 2007
Posts: 116
I place it in
It is still wrong.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61216
    
  66

DON'T put it in the WEB-INF folder.

Put it in webapps.
Hui Zhao
Ranch Hand

Joined: Jul 09, 2007
Posts: 116
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
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
Thanks for youe help, I have resloved it. Just change two lines

to

one line.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: HTTP Status 404 - /Ch03/