aspose file tools*
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes taglib doubt 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 "taglib doubt" Watch "taglib doubt" New topic
Author

taglib doubt

Parth Twari
Ranch Hand

Joined: Jan 20, 2010
Posts: 163
Source; Marcus
Which of the following is a correct taglib declaration within a JSP page?

1)
<%@ taglib uri="WEB-INF/taglib.tld" prefix="h" %>
2)
<%@ taglib tagdir="/WEB-INF/tags/taglib.tld" prefix="h" %>
3)
<%@ taglib tagdir="/WEB-INF/lib/taglib.tld" prefix="h" %>
4)
<%@ taglib tagdir="/WEB-INF/tags/taglib.tld" prefix="jsp" %>

Answer: 1, 2

But i think only 1 is correct as 2nd is pointing to a file which is wrong, tagdir should point only to a directory
right?


Parth Tiwari
| Pursuing Bachelor of Engineering | OSUM Club Leader | SCJP 6 | SCWCD 5 |...
Frits Walraven
Creator of Enthuware JWS+ V6
Bartender

Joined: Apr 07, 2010
Posts: 1696
    
  25

But i think only 1 is correct as 2nd is pointing to a file which is wrong, tagdir should point only to a directory
right?

You are right it should be a directory, otherwise a translation error arises:
JSP.1.10.2
Indicates this prefix is to be used to identify tag extensions
installed in the /WEB-INF/tags/ directory or a subdirectory.
An implicit tag library descriptor is used (see Section JSP.8.4
for details). A translation error must occur if the value does
not start with /WEB-INF/tags/. A translation error must occur
if the value does not point to a directory that exists
. A
translation error must occur if used in conjunction with the
uri attribute.

Regards,
Frits
Parth Twari
Ranch Hand

Joined: Jan 20, 2010
Posts: 163
ok thanks..
 
jQuery in Action, 2nd edition
 
subject: taglib doubt