File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JSP and the fly likes Implicit mapping of TLDs Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "Implicit mapping of TLDs" Watch "Implicit mapping of TLDs" New topic

Implicit mapping of TLDs

Andreas Christoforides

Joined: Jun 28, 2002
Posts: 4
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 ( 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

=========================<br />SCJP2 (Passed with 89%)<br />SCJP2 (Passed with 93%)<br />Preparing for SCBCD<br />=========================
Simon Brown
sharp shooter, and author
Ranch Hand

Joined: May 10, 2000
Posts: 1913
There's a bug in Tomcat 4.0.3 that actually prevents this from working. Give 4.0.4 a try.
Shawn Bayern
Ranch Hand

Joined: May 06, 2002
Posts: 160
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.

Shawn Bayern<br />"JSTL in Action" <a href="" target="_blank" rel="nofollow"></a>
I agree. Here's the link:
subject: Implicit mapping of TLDs
jQuery in Action, 3rd edition