aspose file tools*
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes tagdir attribute Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark "tagdir attribute" Watch "tagdir attribute" New topic
Author

tagdir attribute

Ronaldo Nazario
Greenhorn

Joined: Sep 30, 2007
Posts: 22
Can the tagdir attribute indicate a .tld file? Isn't it supposed to indicate a directory, where my .tag files are kept?

The value of tagdir must start with WEB-INF/tags, right? So how do I map .tag files which are inside a JAR file in WEB-INF/lib/*.jar/META-INF/tags?

Cheers.
Thuwaragan Sundaramoorthy
Greenhorn

Joined: Jan 11, 2007
Posts: 26
The tag files inside the jar files (/META-INF/tags) must have a .tld file defined.


------------------------------<br />SCJP 1.5
Thuwaragan Sundaramoorthy
Greenhorn

Joined: Jan 11, 2007
Posts: 26
And here is the sample tag lib definition for a tag file:


source: HFSJ
Refer pg. 500 for further details.
Ronaldo Nazario
Greenhorn

Joined: Sep 30, 2007
Posts: 22
Ok, I think I wasn't clear enough.

My question is about a taglib directive "tagdir" attribute.

<%@ taglib prefix="mine" tagdir="WEB-INF/lib/my.jar/META-INF/tags" %>

That's how I should indicate a directory that has tags inside a .jar?

<%@ taligb prefix="mine" tagdir="WEB-INF/tags/descr.tld" %>

Is that correct? Can I put a .tld file as a value of a tagdir attribute? How would that work?
[ October 11, 2007: Message edited by: Ronaldinho Gaucho ]
Amit Goyal
Ranch Hand

Joined: Feb 21, 2006
Posts: 95
Its not correct. See once you declare a tld file for a tag, normal .tld file rules apply and it should be declare using <%@ taglib prefix="mine" uri="uri_of_tld".%>. Note the uri will be used rather then tagdir.


- Amit Goyal
Ronaldo Nazario
Greenhorn

Joined: Sep 30, 2007
Posts: 22
Ok, I got it. It makes sense...
So, to use a tag file that is inside a JAR, I just have to use a taglib directive with a uri value that matches the uri from the TLD which is in the JAR.

Cheers!
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: tagdir attribute
 
Similar Threads
Unable to use tag file deployed in jar file
Tag File Location !!
"taglib" and "uri" attributes of taglib directive
Tag Files : why TLD requires
Tag Files location!!