File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Servlets and the fly likes Help to find the error. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Reply locked New topic

Help to find the error.

dinesh Venkatesan
Ranch Hand

Joined: Oct 12, 2006
Posts: 134
Hi all,

The directory structure i used for my web app is
Jsp Servlets WEB-INF
classes lib web.xml

I tried to invoke my servlet by
But i am getting 404 error. I have given the url-pattern and everything in web.xml.
Please help me to solve this problem.

Thanks in advance!
Rahul Bhattacharjee
Ranch Hand

Joined: Nov 29, 2005
Posts: 2308
404 is for resource not found.
Check once more the web.xml mappings.

Deployment structure should be..
jsp's and HTML's , images should be out side WEB-INF;
jar's should be in lib folder within WEB-INF;classes should be in classes folder inside WEB-INF and web.xml should be inside web.xml.

Rahul Bhattacharjee
LinkedIn - Blog
Prabhu Venkatachalam
Ranch Hand

Joined: Nov 16, 2005
Posts: 502

classes lib web.xml

Move WEB-INF/classes/lib/web.xml to WEB-INF/web.xml.

Have you configured <welcome-file> list in web.xml. If not, then you need to give full path of file you want to access. Something like this,


If you have MyApp/Greet/index.html in webapps directory of tomcat.


Prabhu Venkatachalam<br />SCJP 1.4,SCWCD 1.4<br />
Ben Souther

Joined: Dec 11, 2004
Posts: 13410


It's difficult for us to see what your directory structure is when you enter it that way. If you're still having this problem, post the directory structure again by type it the way Prabhu venkatachalam did.

Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
Ben Souther

Joined: Dec 11, 2004
Posts: 13410

Also, I just noticed that this thread is a continuation of

Please continue the discussion there.
Spreading the conversation over multiple threads creates confusion and wastes people's time.
I agree. Here's the link:
subject: Help to find the error.
It's not a secret anymore!