This week's book giveaway is in the Cloud/Virtualization forum.
We're giving away four copies of Learning OpenStack Networking: Build a solid foundation in virtual networking technologies for OpenStack-based clouds and have James Denton on-line!
See this thread for details.
Win a copy of Learning OpenStack Networking: Build a solid foundation in virtual networking technologies for OpenStack-based clouds this week in the Cloud/Virtualization forum!
    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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Knute Snortum
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Ganesh Patekar
  • Stephan van Hulst
  • Pete Letkeman
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Ron McLeod
  • Vijitha Kumara

Help to find the error.  RSS feed

 
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.
 
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.
 
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,
 
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.
 
Don't get me started about those stupid light bulbs.
    Bookmark Topic Watch Topic
  • New Topic
Boost this thread!