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 HF - Pg 606, Q 2, Answer C Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark "HF - Pg 606, Q 2, Answer C" Watch "HF - Pg 606, Q 2, Answer C" New topic
Author

HF - Pg 606, Q 2, Answer C

Henrik Krievs
Ranch Hand

Joined: Jan 05, 2004
Posts: 60
Is answer C correct ?

I thought the container only looked for TLD's under WEB-INF ?

Rgds, Henrik
Roger Yates
Ranch Hand

Joined: Aug 31, 2004
Posts: 118
Yes it is. If you decide to put your tag files into a jar, the jar needs to contain a TLD for them. This resides in the META-INF directory in the jar file (JAR doesn't have a WEB-INF).
Can't recall where it's first mentioned, but it is mentioned on p548.

--> p476
[ October 15, 2004: Message edited by: Roger Yates ]

Cheers,<br />Roger<br />SCJP 1.2, 1.4, SCBCD 1.3, SCWCD 1.4
Henrik Krievs
Ranch Hand

Joined: Jan 05, 2004
Posts: 60
But it says the TLD will be inside the LIB directory..inside the jar file !

If you put the TLD in WEB-INF/lib - will the container also be aable to find it there ??

Rgds, Henrik
Roger Yates
Ranch Hand

Joined: Aug 31, 2004
Posts: 118
Yes it would - any directory under WEB-INF. But even if it didn't look for TLDs in WEB-INF/lib, the container still knows to look in the lib directory for jar files. It also knows that jar files may contain a META-INF directory containing TLDs, so for each jar it finds, it will look inside for TLDs in the META-INF directory (or subdir).

So in this case the TLD is inside the jar.
The jar is in WEB-INF/lib.
So, by deduction, the TLD is in WEB-INF/lib since that's where the jar it lives in sits.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: HF - Pg 606, Q 2, Answer C