Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Devaka Cooray
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Tim Moores
  • Carey Brown
  • Mikalai Zaikin
Bartenders:
  • Lou Hamers
  • Piet Souris
  • Frits Walraven

Help to find the error.

 
Ranch Hand
Posts: 134
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Ranch Hand
Posts: 2308
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Ranch Hand
Posts: 502
jQuery Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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,
 
Sheriff
Posts: 13411
Firefox Browser VI Editor Redhat
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 VI Editor Redhat
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator
Also, I just noticed that this thread is a continuation of
https://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.
 
Yes, my master! Here is the tiny ad you asked for:
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
    Bookmark Topic Watch Topic
  • New Topic