| Author |
tagdir
|
Daniel Spritzer
Greenhorn
Joined: Apr 26, 2008
Posts: 10
|
|
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
|
 |
omi sharma
Ranch Hand
Joined: Mar 18, 2008
Posts: 489
|
|
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 ]
|
SCJP, OCA 9i application developer, SCWCD 5.
When I was in hell someone told me to get heaven you need to do Java.
|
 |
Daniel Spritzer
Greenhorn
Joined: Apr 26, 2008
Posts: 10
|
|
|
Omi, Thanks for the reply. I understand *where* the container searches, I don't understand the *purpose* of the tagdir attribute.
|
 |
omi sharma
Ranch Hand
Joined: Mar 18, 2008
Posts: 489
|
|
it's purpose is searching those dirs in which you put tag files. best regards, omi
|
 |
Daniel Spritzer
Greenhorn
Joined: Apr 26, 2008
Posts: 10
|
|
|
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
Joined: Dec 20, 2007
Posts: 45
|
|
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
|
SCJP 5<br />SCBCD 1.3<br />SCJD<br />SCWCD 1.4, 5<br />SCBCD 5 -- working on it
|
 |
Kumar Garlapati
Ranch Hand
Joined: Feb 04, 2008
Posts: 38
|
|
|
Good one John, thanks.
|
Regards,<br />Kumar
|
 |
 |
|
|
subject: tagdir
|
|
|