This week's book giveaway is in the Big Data forum.
We're giving away four copies of Elasticsearch in Action and have Radu Gheorghe & Matthew Lee Hinman on-line!
See this thread for details.
The moose likes Servlets and the fly likes servlets and new web directory Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Elasticsearch in Action this week in the Big Data forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "servlets and new web directory" Watch "servlets and new web directory" New topic

servlets and new web directory

david allen
Ranch Hand

Joined: Sep 27, 2002
Posts: 185
Hi all,
I have the servlets in the examples folder that comes with tomcat running fine.
I have created a new directory under webapps called site1. I have added a WEB-INF directory and a directory called classes. I have added a very simple servlet called HelloWorld to site1/WEB-INF/classes.
After restarting tomcat i goto the following url
It generates a 404 error.
However if i put the same servlet in the examples/WEB-INF/classes folder and access it using its URL it works fine.
I think it may have something to do with the web.xml file. Do I have to update that with the details of my servlet and if so how?
Regards david
david allen
Ranch Hand

Joined: Sep 27, 2002
Posts: 185
i have it working now
I agree. Here's the link:
subject: servlets and new web directory