• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Rob Spoor
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Henry Wong
  • Liutauras Vilda
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Tim Holloway
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Mikalai Zaikin
  • Piet Souris

taglib directive for tag files

 
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Sheriff
Posts: 14691
16
Eclipse IDE VI Editor Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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/.
 
You showed up just in time for the waffles! And this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic