Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Apache Tomcat and Servlet

 
shivani anand
Ranch Hand
Posts: 155
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi!
I've downloaded Apache Tomcat and I am trying to test some servlets. My .jsp and .html files are working fine but when I am trying to load servlet through Browser it's giving.....
The requested resource (/servlet/HelloServlet) is not available
I've saved my HelloServlet.java file in ...
C:\jakarta-tomcat-4.0.1\webapps\ROOT\WEB-INF
It is also not giving any compilation problem. My HelloServlet.class file is also in \WEB-INF dir.
can anybody give me idea why this is happening.
thanks,
Shivani
 
Corey McGlone
Ranch Hand
Posts: 3271
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You might want to try mapping the servlet in a *-apps.xml file. I'm sorry if this is a little off as I can't look at my Tomcat config at the moment.
However, if you look in the conf directory, you should see a file that's named examples-apps.xml or something similar. Create one like that for your application (call it myApp-apps.xml, for example). That file will automatically be read when the server starts.
Let me know if that helps,
Corey
P.S.
You'd probably get a lot better help in the Apache/Tomcat forum.
 
Dave Vick
Ranch Hand
Posts: 3244
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
shivani
Your compiled servlets should be in the WEB-INF/classes directory in tomcat. That's the server can't find them.
Dave
 
Corey McGlone
Ranch Hand
Posts: 3271
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Dave Vick:
Your compiled servlets should be in the WEB-INF/classes directory in tomcat.

Oh yeah - I forgot about the classes directory. Sorry. Dave's right.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic