• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Four places the Container looks for TLDs - Errata for HFSJ

 
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Ranch Hand
Posts: 142
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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?
 
Neal Pressley
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 142
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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 ]
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic