File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
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


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "where should the servlet.jar file be?" Watch "where should the servlet.jar file be?" New topic
Author

where should the servlet.jar file be?

anrup kris
Greenhorn

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
C:\JDK1.3\
somebody help!!
thanks
kris
Ashwin Desai
Ranch Hand

Joined: Jul 17, 2000
Posts: 124
Hi,
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)
CLASSPATH=$CLASSPATH:/home/Java/servlet.jar
export CLASSPATH
Or
(Csh) :
setenv CLASSPATH $CLASSPATH:/home/Java/servlet.jar
You need not change the physical location of the file.
Ashwin.
Prasad Charasala
Ranch Hand

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

------------------
Prasad


<B>Prasad</B>
anrup kris
Greenhorn

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

Joined: Oct 22, 2000
Posts: 17
I have yet another question.
I created a servlet called My SimpleServlet.class located in
c:/tomcat/webapps/examples/web-inf/classes.
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??
thanx
kris
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: where should the servlet.jar file be?
 
Similar Threads
Duh in Servlets
CLASSPATH in Windows 2003 server
Trying to find javax, to compile Tomcat servlet
package javax.servlet not found in import?
JavaServlet-CLASSPATH problem