This week's book giveaway is in the Other Languages forum.
We're giving away four copies of Functional Reactive Programming and have Stephen Blackheath and Anthony Jones on-line!
See this thread for details.
Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

tagdir

 
Daniel Spritzer
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • 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
 
Bobby Sharma
Ranch Hand
Posts: 598
3
Google App Engine jQuery Windows
  • Mark post as helpful
  • send pies
  • 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
  • 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
Google App Engine jQuery Windows
  • Mark post as helpful
  • send pies
  • 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
  • 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?
 
John Donoghue
Ranch Hand
Posts: 45
IntelliJ IDE Mac OS X Scala
  • Mark post as helpful
  • send pies
  • 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
 
Kumar Garlapati
Ranch Hand
Posts: 38
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Good one John, thanks.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic