my dog learned polymorphism*
The moose likes Servlets and the fly likes Apache Tomcat and Servlet Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "Apache Tomcat and Servlet" Watch "Apache Tomcat and Servlet" New topic
Author

Apache Tomcat and Servlet

shivani anand
Ranch Hand

Joined: Dec 28, 2000
Posts: 155
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

Joined: Dec 20, 2001
Posts: 3271
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.


SCJP Tipline, etc.
Dave Vick
Ranch Hand

Joined: May 10, 2001
Posts: 3244
shivani
Your compiled servlets should be in the WEB-INF/classes directory in tomcat. That's the server can't find them.
Dave


Dave
Corey McGlone
Ranch Hand

Joined: Dec 20, 2001
Posts: 3271
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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Apache Tomcat and Servlet
 
Similar Threads
Unable to run servlet on my machine
servlets
need help in compiling servlet
JSTL installation
How to deploy my own webapplication