This week's book giveaway is in the Design forum.
We're giving away four copies of Design for the Mind and have Victor S. Yocco on-line!
See this thread for details.
Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Unable to retrieve configuration information from the application web.xml file

 
Jdinesh Tiwari
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,
I was trying to obtain configuration information from the application web.xml file
The steps I followed as follows:-
created directory structure under C: in tomcat folder as-
webapps->dinesh1-WEB-INF->classes
web.xml This file is kept in my WEB-INF Folder)

The ConfigDemoServlet.java –(This is kept in classes folder under WEB-INF and has been compiled as well)


Server Started Successfully

Local host is running fine

But when I provide the url:

http://localhost:8080/dinesh1/ConfigDemoServlet

It shows 404 error

Where I went wrong ? May help me please.
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13058
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You went wrong with this common error:



ALL classes used in servlets MUST be in packages and the class file in the corresponding directory. You got 404 because the container could not find the class file and the servlet never started. The full class name with package must appear in the servlet-class tag.



Bill
 
mohammed R farook
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
code seems to be fine. where you kept this class file . this should be under WEB-INF/classes and also map this servlet to some url pattern in web.xml

hope this will help you
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic