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 taglib doubt Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Reply 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
Rancher

Joined: Apr 07, 2010
Posts: 1064

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..
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: taglib doubt
 
Similar Threads
XML Namespace Spec
Exmulator mock exam question 36
uri vs tagdir in tablib doubt
Doubt in mocktest
Tag File Mock Question