File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Servlets and the fly likes where should the servlet.jar file be? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "where should the servlet.jar file be?" Watch "where should the servlet.jar file be?" New topic

where should the servlet.jar file be?

anrup kris

Joined: Oct 22, 2000
Posts: 17
I am new to servlets and hopelessly floundering.
I downloaded Tomcat4.0 ,and I tried a HelloWorld servlet.
My problem is the jdk1.3 doesn't come with javax.servlet API,
and I dont knopw where to get it.
Where exactly do I download the class files from Sun for the servlet package. There is a servlet.jar file in Tomcat4.0 servlet api specification.Should I be including this in
somebody help!!
Ashwin Desai
Ranch Hand

Joined: Jul 17, 2000
Posts: 124
You need to include that in the CLASSPATH variable.
For e.g. Assuming this file is in C:\Java
On Windows
set CLASSPATH=%CLASSPATH%;c:\Java\servlet.jar
On Unix, (assuming /home/Java)
(Csh) :
setenv CLASSPATH $CLASSPATH:/home/Java/servlet.jar
You need not change the physical location of the file.
Prasad Charasala
Ranch Hand

Joined: Nov 02, 2000
Posts: 67
All the servlet related packages come along with tomcat. If you see in the tomcat\lib folder you will find servlet.jar there.


anrup kris

Joined: Oct 22, 2000
Posts: 17
Thanx! it worked
anrup kris

Joined: Oct 22, 2000
Posts: 17
I have yet another question.
I created a servlet called My SimpleServlet.class located in
I type in a request http://localhost:8080/examples/servlet/SimpleServlet.
My server has to locate the servlet and execute the app.How the heck does it find my servlet which is sitting in c:/tomcat/.. dir ?? from the path specified in the url
I can't find any relative/absolute path to the dir listed as examples/servlet/ -->
I waded thru tomcat documentation to see if I could get anything there.
I got something to the effect that when the context is
mounted in the tomcat.conf file at the time of tomcat initialization
as in " ApJServMount /examples /root "
" all the web server paths that start with /examples go to Tomcat."
Can anyone clarify this for me??
I agree. Here's the link:
subject: where should the servlet.jar file be?
It's not a secret anymore!