This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
Given a tag library descriptor located at /mywebapp/WEB-INF/tlds/mytags.tld which would be the correct taglib directive? Assume mywebapp is the web application root and that there ara no <taglib> tags in the deployment descriptor.
A. <%@ taglib uri="/mytags.tld" prefix="my" %> B. <%@ taglib uri="/tlds/mytags.tld" prefix="my" %> C. <%@ taglib uri="/WEB-INF/tlds/mytags.tld" prefix="my" %> D. <%@ taglib uri="/mywebapp/WEB-INF/tlds/mytags.tld" prefix="my" %> E. /mywebapp/WEB-INF/tlds/mytags.tld is NOT a valid location for a tag library descriptor, so none of these will work
The correct answer is C because, in the abscence of a <taglib> element in the DD, the URI must be a full path relative to the application root.
I think it is false. If the tld, as it is located on /WEB-INF/tlds/, has a <uri>MY_URI_NAME</uri>, then, the correct answer should be:
<%@ taglib uri="MY_URI_NAME" prefix="my" %>
The uri name determines the uri attribute of the taglib determine.