Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Location of tld files

 
Jim So
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I got this from HFS p486

Tld files can be located :
1. Directly inside WEB-INF
2. Directly inside a sub directory of WEB-INF
3. WEB-INF/lib/jar/META-INF/
4. In a subdirectory of WEB-INF/lib/jar/META-INF/

Question: If it can be located directly inside a sub directory of WEB-INF, then can a tld be located by the container if its situated within /classes or /lib ? or are these two folders not searched by the container?

I also I read the next chapter on tag files. It mentiones that you only need to declare a tld file, if the tag file is located in a jar file.
So what happens if your tag file is located inside the /WEB-INF/tags location.

Question 2: So if the tag file (Header.tag) is located in /WEB-INF/tags and there is no tld file defined. Does this mean i have to have a 'tagdir' defined in a taglib directive in my jsp:

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

<myTags:Header />

Or since the tag file is in /WEB-INF/tags, do i not need to specify the tagdir? E.g. Can i just say:

<%@ taglib prefix="myTags" %>

<myTags:Header />

Since Header.tag exists in a folder that the container searches?
 
vani venkat
Ranch Hand
Posts: 142
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I also I read the next chapter on tag files. It mentiones that you only need to declare a tld file, if the tag file is located in a jar file.
So what happens if your tag file is located inside the /WEB-INF/tags location.



you donot need to declare a tld file for tags inside web-inf/tags directory or its sub directories.

for the second question, taglib directive should have either uri or tagdir , see this
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic