File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes import javax.servlet.* error Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark "import javax.servlet.* error" Watch "import javax.servlet.* error" New topic

import javax.servlet.* error

Seema Ahuja
Ranch Hand

Joined: Feb 01, 2006
Posts: 32
Hi all,

I am trying to work out the Beer Selection example given in head first book.
I have jdk1.5.0_01 installed and apache-tomcat-5.5.20 version of tomcat installed. I read some where that j2ee.jar file in the lib directory should be placed in the classpath.Having done that i sill get the " import javax.servlet.* package javax.servlet does not exist" error.
Also i noticed that in the my jdk folder i have a package named javax but inside that there was no package named servlet.

Please let me know as to where i am going wrong in this web app?
awaiting your response

Kishore Balla
Ranch Hand

Joined: Jun 08, 2005
Posts: 165
I guess you need to add servlet-api.jar to your classpath..

Its path will be something like below

C:\Program Files\Apache Software Foundation\Tomcat 5.5\common\lib\servlet-api.jar

SCJP 5.0 : 88% My Story, SCWCD 1.4 : 94% My Story
Seema Ahuja
Ranch Hand

Joined: Feb 01, 2006
Posts: 32
Thanks!! That worked !!
I agree. Here's the link:
subject: import javax.servlet.* error
It's not a secret anymore!