hey ranchers,
please try to correct me if I am wrong. question from enthuware mock...
You have a
JSP page that contains the following taglib directive for accessing tags of a tag library developed by ABC, Inc.:
<%@ taglib prefix="
test" uri="
http://abc.com/graphs/graphlib.jar">
Further, the tag library is shipped to you in the form of a jar file named graphlib.jar.
You've kept this jar file in WEB-INF/lib directory of your web application.
Which of the following lines will you add in the deployment descriptor so that your jsp page can access the tags of the library?
1. <taglib>
<taglib-uri>
http://abc.com/graphs/graphlib.jar</taglib-uri>
<taglib-location>/lib/graphlib.jar</taglib-location>
</taglib>
2. <taglib>
<taglib-uri>
http://abc.com/graphs/graphlib.jar</taglib-uri>
</taglib>
3. <taglib>
<taglib-uri>http://abc.com/graphs/graphlib.jar</taglib-uri>
<taglib-location>lib/graphlib.jar</taglib-location>
</taglib>
4. There is no need for a <taglib> element in web.xml, as the library will be downloaded from
http://abc.com/graphs/graphlib.jar
5. None of these.
how option 3 would be the correct one.
1. when we specify
uri attribute in the <taglib> directive it has the same value as <uri> tag in the TLD
OR
2. it has the same value as <taglib-uri> (sub-element of <taglib>)specified in the web.xml file.
according to me option 4 would be thw correct one, because when you place the tag library at the allowed location there is no need for explicit mapping in web.xml.
no matter even if the tag library placed in the form of .jar.
Please help me to get the correct one... got really confused. it seems my tag library knowledge vanishes
Thanks