File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

taglib directive for tag files

 
Xiaoxiao Lam
Greenhorn
Posts: 27
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I know if a tag file is not inside a jar, we don't need to make a TLD file for it and just use a "tagdir" attribute to describe the location of the tag file.

But when the tag file is inside a jar/META-INF and we have to make a TLD file for it. For example, if the TLD looks like this:

<taglib...>
<tlib-version>1.0</tlb-version>
<uri>myTagFile</uri>
<tag-file>
<name>Header</name>
<path>/META-INF/tags/Header.tag</path>
</tag-file>
</taglib>

In this case, when we want to use the the tag file in a jsp file, what does the taglib directive look like? Should we use the "tagdir" attribute or "uri" attribute?

Which one is right:
<%@taglib tagdir="/META-INF/tags/Header.tag" %>
or
<%@taglib uri="myTagFile" %>

or neither of them are right? Thank you.
 
Christophe Verré
Sheriff
Pie
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can only use the uri.
According to the spec, a translation error must occur if the value of tagdir does not start with /WEB-INF/tags/.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic