File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Implicit mapping of TLDs

 
Andreas Christoforides
Greenhorn
Posts: 4
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Im trying to use a custom library that is in a JAR file. The JSP container is suppose to check the TLD files in all JAR files in /WEB-INF/lib and create implicit mapping between the contents of <uri> tags of the TLDs to the location of the JAR files.
This is what I have done so far:
1. Created a taglib.tld in a directory META-INF in the JAR file
2. Specified a URI in the <uri> tag of taglib.tld
3. Placed the JAR file under /WEB-INF/lib
4. Tried to access library with a taglib directive that I specified in the taglib.tld
However, when I use an absolute uri in taglib.tld and try to access the jsp that uses the library I get:
org.apache.jasper.JasperException: This absolute uri (http://www.test.com) cannot be resolved in either web.xml or the jar files deployed with this application
When i use a root relative or non-root relative uri in the <uri> tag of taglib.tld (MyTag or /Mytag) I get:
org.apache.jasper.JasperException: File "/MyTag" not found
Am I missing something ? I've been trying to find the problem for 2 days. Im using Tomcat 4.0.3
Thanks,
Andreas
 
Simon Brown
sharp shooter, and author
Ranch Hand
Posts: 1913
6
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There's a bug in Tomcat 4.0.3 that actually prevents this from working. Give 4.0.4 a try.
Simon
 
Shawn Bayern
Author
Ranch Hand
Posts: 160
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Andreas Christoforides:
Am I missing something ? I've been trying to find the problem for 2 days. Im using Tomcat 4.0.3

You can also create a directory 'temp' under your Tomcat distribution's directory (that is, coordinate with 'work', 'conf', 'webapps', and the rest). The Tomcat 4.0.4 distribution works out of the box, as Simon says, because it includes this 'temp' directory by default.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic