This week's book giveaway is in the Kotlin forum.
We're giving away four copies of Kotlin in Action and have Dmitry Jemerov & Svetlana Isakova on-line!
See this thread for details.
Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Simple Tag Libraries (strange problems indeed!)  RSS feed

 
Dane Frazier
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I've been trying to get custom tag libs to work, and here's the short of what I have tried...
JDK1.3.x & Tomcat3.3.1
JDK1.4.x & Tomcat4.0.4
jBuilder6 & JDK1.3.x & Tomcat 3.2.3
(nearing an exercise in futility: all I want to do is reduce the spaghetti in my servlets and create some clean JSPs...)
All application containers give a variation of the same resulting error: (from tomcat4.x)
org.apache.jasper.compiler.CompileException: /HelloUser1.jsp(7,2) Unable to load class HelloUser

Which leads me to believe that I have all parts working but a problem with the classes being found. (btw: I can serve other JSP / beans from this directory)
it's funny, but everything looks okay?!!?
I'll take any information that you can offer.
Thanks,
Dane
JDK1.4 & Tomcat4.0.4
directory structure:

/test/HelloUser.jsp
/test/web-inf/web.xml
/test/web-inf/hellouser1tags.tld
/test/web-inf/classes/HelloUser.class

From this simple layout, I have the following for each piece:
HelloUser.java

hellouser1tags.tld

hellouser.jsp

web.xml
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66205
151
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm not sure if this is your problem or not, but I've read a number of threads here which describe problems with classes defined in the default package.
You might want to try putting your tag handler class in a non-default package (which is good practice in any case) and see if that clears things up.
hth,
bear
 
Simon Brown
sharp shooter, and author
Ranch Hand
Posts: 1913
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yep ... I second that suggestion.
Simon
 
Dane Frazier
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello All,
Many thanks.
Here's what I did to resolve:
Upgraded to JDK1.4.x and Tomcat4.0.4
Configured TC to run root/docroot where I wanted. Tested TC configuration with pages / classes known to work in my prod environment.
Re-compiled class with package see.my.pain;
re-configured TLD to point to new class see.my.pain.HelloUser.
Changed tag-name of class in TLD to "mixed" case letters.
I see how the interactions occur now, and am off and running -
Thanks for the help.
Dane
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!