This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
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


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Servlets
Reply locked New topic
Author

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
MyApp
Jsp Servlets WEB-INF
classes lib web.xml

I tried to invoke my servlet by
http://localhost:8080/MyApp/Greet
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!
dinesh.
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,

http://localhost:8080/MyApp/Greet/index.html

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

hth,


Prabhu Venkatachalam<br />SCJP 1.4,SCWCD 1.4<br />prabhu.venkatachalam@gmail.com
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

dinesh,

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
Sheriff

Joined: Dec 11, 2004
Posts: 13410

Also, I just noticed that this thread is a continuation of
http://www.coderanch.com/t/363679/Servlets/java/Guidance

Please continue the discussion there.
Spreading the conversation over multiple threads creates confusion and wastes people's time.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Help to find the error.
 
Similar Threads
Please help me about JSP rollDice (HFSJ)
setting up Tomcat
Tomcat Error 404
Problem accessing servlet through Tomcat 5.0.28
No Response After Deployment