Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Errors in compile jsp custom tag, please help

 
hong zhang
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 13074
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 30
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 13074
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 30
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Bill, Thanks a lot for the help. I clean up the old version of the servlet.jar and now it works.
Thanks again!
Hong
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic