File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes Location of tld files Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark "Location of tld files" Watch "Location of tld files" New topic
Author

Location of tld files

Jim So
Greenhorn

Joined: Mar 18, 2009
Posts: 28
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

Joined: Nov 21, 2006
Posts: 142
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


SCJP 1.4, SCWCD 1.5
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Location of tld files