This week's book giveaway is in the Agile forum.
We're giving away four copies of Fixing your Scrum and have Ryan Ripley & Todd Miller on-line!
See this thread for details.
Win a copy of Fixing your Scrum this week in the Agile forum!
  • 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
  • Paul Clapham
  • Rob Spoor
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Junilu Lacar
  • Tim Cooke
Saloon Keepers:
  • Tim Holloway
  • Piet Souris
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
Bartenders:
  • Frits Walraven
  • Himai Minh

tagdir

 
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello all,

I'm confused as to the purpose of the tagdir attribute in the taglib directive.

On page 492 of HFSJ 1.4, it gives an example:
<%@taglib prefix="mytags" tagdir="/WEB-INF/tags" %>

On page 499, it describes the 4 places the container will search for .tag files. So what exactly is the purpose of the tagdir if the container will only search 4 specific locations?

Thanks
Daniel
 
Ranch Hand
Posts: 598
3
jQuery Google App Engine Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Daniel Spritzer:
Hello all,

I'm confused as to the purpose of the tagdir attribute in the taglib directive.

On page 492 of HFSJ 1.4, it gives an example:
<%@taglib prefix="mytags" tagdir="/WEB-INF/tags" %>

On page 499, it describes the 4 places the container will search for .tag files. So what exactly is the purpose of the tagdir if the container will only search 4 specific locations?

Thanks
Daniel



According to the Jsp specs,The tag file should be particularly 4 places,
they are:
* WEB-INF/tags and the sub directory of it viz. WEB-INF/tags/foo
* META-INF/tags and the sub directory of it META-INF/tags/bar
Note:META-INF directory resides into lib directort(WEB-INF/lib)
so my friend,don't get frustrated because it's just the rule.

best regards,
omi
[ May 03, 2008: Message edited by: omi sharma ]
 
Daniel Spritzer
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Omi, Thanks for the reply. I understand *where* the container searches, I don't understand the *purpose* of the tagdir attribute.
 
Bobby Sharma
Ranch Hand
Posts: 598
3
jQuery Google App Engine Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
it's purpose is searching those dirs in which you put tag files.

best regards,
omi
 
Daniel Spritzer
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Exactly, but if you already have 4 predefined locations of where the tag files can go, why is the 'tagdir' attribute necessary?
 
Ranch Hand
Posts: 45
Scala Mac OS X IntelliJ IDE
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I may be wrong here, but I think that it is to prevent namespace collisions.

Say that one tag file had a function "sort" for cards. In another we have function "sort" for laundry (I know it is a silly example). If both are in the same web app in two different files in different directories, how does the container know which to use? The tagdir directive associates the first with the prefix "cards" and the second with the prefix "laundry", and then we use <cards:sort/> or <laundry:sort/> so the the container gets the right one.

-John
 
Ranch Hand
Posts: 38
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Good one John, thanks.
 
There are 29 Knuts in one Sickle, and 17 Sickles make up a Galleon. 42 tiny ads in a knut:
the value of filler advertising in 2021
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic