Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

servlets and new web directory

 
david allen
Ranch Hand
Posts: 185
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
http://localhost:8080/site1/servlet/HelloWorld.
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
Posts: 185
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i have it working now
thanks
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic