| Author |
Taglib and Tagdir question?
|
Ernesto Leyva
Ranch Hand
Joined: Feb 23, 2006
Posts: 62
|
|
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.
|
 |
Frederic Esnault
Ranch Hand
Joined: Feb 13, 2006
Posts: 284
|
|
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
|
SCJP 5 - SCWCD 1.4 - SCBCD 1.3 - Certification study documents/resources: http://esnault.frederic.free.fr/certification
|
 |
Ernesto Leyva
Ranch Hand
Joined: Feb 23, 2006
Posts: 62
|
|
|
ok thanks for the answer
|
 |
Alex Matute
Greenhorn
Joined: Jun 28, 2005
Posts: 14
|
|
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
|
 |
 |
|
|
subject: Taglib and Tagdir question?
|
|
|