Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

HFSJ Edition 2 Final mock exam QNo:49

 
Niteen Patil
Ranch Hand
Posts: 45
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Given:
1. <%@ taglib prefix="c" uri="http://java.sun.com/jsp/
jstl/core" %>
2. <%@ taglib prefix="tables" uri="http://www.javaranch.
com/tables" %>
3. <%@ taglib prefix="jsp" tagdir="/WEB-INF/tags" %>
4. <%@ taglib uri="UtilityFunctions" prefix="util" %>
What about the above taglib directives would cause the JSP to not function?
A. Line 4 is wrong because the prefix attribute must come before the
uri attribute.
B. Line 3 is wrong because there is no uri attribute.
C. Line 4 is wrong because the uri value must begin with http://
D. Line 3 is wrong because the prefix jsp is reserved for standard actions.

Answer given is : C.

The value in the uri attribute used in the tag must match with the value of the <uri> tag in TLD.
We can specify any value for uri such as: UtilityFunctions or a uri starting with http:// or ftp:// it doesn't matter.
So how come the option C is a valid answer.
Please clarify my doubt.
Thanks in advance.






 
Kapil Mishra
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
check errata for this book-

http://oreilly.com/catalog/errata.csp?isbn=9780596516680
 
avi sinha
Ranch Hand
Posts: 453
Google Web Toolkit Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
jsp is a reserved word . so i think answer should be D.

also of the three attributes id,uri and tagDir

id is mandatory
either of uri or tagDir is mandatory (i.e. of the two , one must be there)


avi sinha
 
Niteen Patil
Ranch Hand
Posts: 45
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I too think that option D is the correct answer.
Thanks for the reply.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic