aspose file tools*
The moose likes Servlets and the fly likes Errors in compile jsp custom tag, please help Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "Errors in compile jsp custom tag, please help" Watch "Errors in compile jsp custom tag, please help" New topic
Author

Errors in compile jsp custom tag, please help

hong zhang
Ranch Hand

Joined: Jun 07, 2001
Posts: 30
Hi.
I'm reading chapter 8 (Introducing Custom Tags) in the book Pro JSP 2nd edition, and try to experiment the book example. When I tried to compile the JavaScriptExampleTag.java, I got complilation error as:
"package javax.servlet.jsp.tagext does not exit" with the arrow pointing to the statement:
import javax.servlet.jsp.*;
import javax.servlet.jsp.tagext.*;
I'm using jdk1.3 and tomcat4.0 beta5, and put the Root/servletapi-javadoc/javax/ into the path. but no luck.
Any advice? Thanks much in advance.
Hong
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12823
    
    5
Root/servletapi-javadoc/javax/
is the location of the documentation for the javax.servlet. etc package, the compiled class library lives in
common/lib/servlet.jar
which is where your CLASSPATH (not path) should point.
(I don't know why the Tomcat 4 b5 changed where jar files live, but there it is.)
Bill

------------------
author of:
hong zhang
Ranch Hand

Joined: Jun 07, 2001
Posts: 30
I added the servlet.jar to CLASSPATH, I still got error message "package javax.servlet.jsp.tagext does not exist" in compile the program JavaScriptExampleTag.java. Are there anything else I missing? Please help. Thanks much.
Hong
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12823
    
    5
Is it possible that there is a servlet.jar or jsdk.jar file from an earlier version of Tomcat or the old JSDK hanging around on your system somewhere? Possibly in your JAVA_HOME\jre\lib\ext directory?
I spent several very frustrating days chasing down an error like this when moving from an early JRun to Tomcat.
Bill
hong zhang
Ranch Hand

Joined: Jun 07, 2001
Posts: 30
Bill, Thanks a lot for the help. I clean up the old version of the servlet.jar and now it works.
Thanks again!
Hong
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Errors in compile jsp custom tag, please help