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 Help Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "Help" Watch "Help" New topic
Author

Help

Chris Goh
Greenhorn

Joined: Aug 23, 2001
Posts: 23
TestDispatcherServlet1.java:4: package javax.servlet does not exist
import javax.servlet.*;
TestDispatcherServlet1.java:5: package javax.servlet.http does not exist
import javax.servlet.http.*;
can anyone tell me what is wrong with it?
-Newbie-
Malhar Barai
Author
Ranch Hand

Joined: Aug 17, 2001
Posts: 399
hv u set the CLASSPATH to where yr "javax" package exists...
check it...might help..
else get back ASAP...
good luck
malhar


Malhar Barai
SOA & Java Book
Chris Goh
Greenhorn

Joined: Aug 23, 2001
Posts: 23
erm... where would the classpath be normally pointed?
is it somewhere in the tomcat folders?
Axel Janssen
Ranch Hand

Joined: Jan 08, 2001
Posts: 2164
Hi Chris,
servlet.jar is in:
%Tomcat%\lib (Tomcat 3.2)
%Tomcat%\common\lib (Tomcat 4.0)
In Windows you change your Classpath variable simple with:
Set Classpath=%Classpath%;C:\tomcat\lib\servlet.jar;.
(in my case using the Tomcat3.2 which is in C:\tomcat)
You may check your class variable by typing set in the Dos-Console.
Axel
Chris Goh
Greenhorn

Joined: Aug 23, 2001
Posts: 23
Thanks!!!
I can compile my servlets!!!
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Help