Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
    Bookmark Topic Watch Topic
  • New Topic

Help to find the error.

 
dinesh Venkatesan
Ranch Hand
Posts: 134
  • Mark post as helpful
  • send pies
  • Report post to moderator
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
Posts: 2308
  • Mark post as helpful
  • send pies
  • Report post to moderator
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.
 
Prabhu Venkatachalam
Ranch Hand
Posts: 502
Java jQuery Spring
  • Mark post as helpful
  • send pies
  • Report post to moderator
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,
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Report post to moderator
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.
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Report post to moderator
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.
 
    Bookmark Topic Watch Topic
  • New Topic