File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

taglib doubt

 
Parth Twari
Ranch Hand
Posts: 163
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?
 
Frits Walraven
Creator of Enthuware JWS+ V6
Saloon Keeper
Pie
Posts: 2167
57
Android Chrome Eclipse IDE
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 163
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
ok thanks..
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic