• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Taglib and Tagdir question?

 
Ranch Hand
Posts: 62
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I got a question regarding tag files:

According to the HFJS a tag file can be only in the following places:

1) WEB-INF/tags
2) WEB-INF/tags/<subdirectory>
jar file:
3) META-INF/tags
4) META-INF/tags/<subdirectory>

Additionally the extension of the tag file should be: tag
and the name of the tag file and custom tag must match.

Then what is the purpose of using the "tagdir" in the page directive "taglib" i.e.

<%@ taglib prefix="mytag" tagdir="WEB-INF/tags" %>

The container by default should search and match my tag with the standard places. The only I can think of is performance optimization.
 
Ranch Hand
Posts: 284
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
tagdir is usedto specify the directory relative to which the container must look for your tagfiles:

You may use
<%@ tagdir="WEB-INF/tags/foo/bar" prefix="myTags" %>

then use a tag like this :
<myTags:atag/> to access a tag file which path is :
/WEB-INF/foo/bar/atag.tag
 
Ernesto Leyva
Ranch Hand
Posts: 62
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
ok thanks for the answer
 
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Sorry guys, but I still don't understand. I agree with Ernesto in that I don't see the point of using tagdir, since the TAG files will still be searched by the container in the 4 places that p. 499 indicates; or will it listen to the tagdir attribute and ignore those 4 places if the attribute exists? In that case, tagdir should not be mandatory, is it?

Frederic, according to your example, where does this 4 places take place?

Pleasy clarify...

--alex


-------------------------
SCJD
 
Skool. Stay in. Smartness. Tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic