• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Confusion on tag libraries

 
Padma priya Gururajan
Ranch Hand
Posts: 437
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
Can you tell me the correct answer?
You are working with a tag library which is packaged in a jar file named htmlutil.jar.
This jar file also contains a META-INF/htmlutil.tld file which has a uri element as follows:
<uri>http://www.xyzcorp.com/htmlLib</uri>
What can you do to access this library from your JSP pages
Select 1 correct option.
A.You must define the <taglib> element in the web.xml to specify
the mapping for <taglib-uri> to the location of this jar file.
B.There is no need for the <taglib> element in the web.xml, however, you need the taglib directive in the JSP pages.
C.You can directly access the tags of this library from the JSP pages without any taglib directive.
D.You do not need the taglib directive, but you do need to specify the <taglib> element in the web.xml.
E.None of these.
 
Amol Nayak
Ranch Hand
Posts: 218
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
B is the correct option.
<%@taglib prefix="pre" uri="--" %>

This uri should match the uri specified in the <uri> tag of tld.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic