aspose file tools*
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes Four places the Container looks for TLDs - Errata for HFSJ 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 "Four places the Container looks for TLDs - Errata for HFSJ" Watch "Four places the Container looks for TLDs - Errata for HFSJ" New topic
Author

Four places the Container looks for TLDs - Errata for HFSJ

Neal Pressley
Greenhorn

Joined: May 29, 2008
Posts: 14
Page 476 of Head First Servlet and JSP says that the four places
where containier looks for TLDs are
1. Directly inside WEB-INF
2. Directly inside a sub-directory of WEB-INF
3. Inside the META-INF directory inside a JAR file that's inside WEB-INF/lib
4. Inside a sub-directory of META-INF inside a JAR file thats's inside WEB-INF/lib

Reading (2) above made me feel that the containder will look for the TLDs directly inside a sub-directory of WEB-INFs but will NOT traverser through layers of subdirectories to find it. For example
I can have /myapp/WEB-INF/myFunctions.tld or /myapp/WEB-INF/tlds/myFunctions.tld
but we can not have /myapp/WEB-INF/tlds/core/myFunctions.tld

Again, as (3) and (4) does not use the word "directly", it makes me "feel' that the container will be able to locate the TLDs from any place under
the folder /myapp/WEB-INF/lib/jar/META-INF. Either directly under, or directly under a direct sub-directory or under any layer of sub-directory.

Now, when I come to page 485, the answer of Question 1 indicates that the TLD file may be placed in any subdirectory of WEB-INF.
This contradicts (1) and (2).

Please advise if the answer at 485 is wrong of the use of word "Directly" at page 476 is wrong.
Jan Sterk
Ranch Hand

Joined: Jun 06, 2008
Posts: 139
Maybe 'directly' is meant as opposed to inside a jar..

Since we're on the subject (hope I'm not stealing your thread) - a brief question: can a TLD be inside the classes and/or lib directory/ies?


SCJP 1.4 (81%)<br />SCWCD 5 (95%)
Neal Pressley
Greenhorn

Joined: May 29, 2008
Posts: 14
Problem is that if "directly" does not mean "directly" in (1) and (2) above than (1) and (2) together means you can put TLD any where under WEB-INF AND container will find it. When I say "any-where" , I mean anywhere.. even like /myapps/WEB-INF/dir1/dir2/dir3/myLost.tld and surprisingly (3) (4) will not required to be mentioned separately as they are also under WEB-INF.
Jan Sterk
Ranch Hand

Joined: Jun 06, 2008
Posts: 139
3 and 4 refer to a jar-file.

jar != directory. So they have to be mentioned seperately.
[ June 12, 2008: Message edited by: Jan Sterk ]
 
wood burning stoves
 
subject: Four places the Container looks for TLDs - Errata for HFSJ