Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

taglib-uri

 
Mathew Kuruvilla
Ranch Hand
Posts: 145
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
what is the exact relationship between the following URIs?
I know that the uris in 1) and 2) are supposed to be identical. What about the third uri in the .tld file? Is there any requirement for it to be the same as the first? What if it is not available? Simplest thing to do WOULD be to try it out. :-)
1) In a JSP file:
<%@ taglib prefix="test" uri="http://www.myserver.com/tagteeld" %>
2) In a web.xml file:
<web-app>
<!-- Other Elements -->
<taglib>
<taglib-uri>
http://www.myserver.com/tagteeld
</taglib-uri>
<taglib-location>
/tags/scwcd.tld
</taglib-location>
</taglib>
3) In a tld file:
<? xml stuff etc.>
<taglib>
<!-- other elements -->
<uri>http://www.myserver.com/tagteeld</uri>
</taglib>
 
Fisher Daniel
Ranch Hand
Posts: 582
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
JSP container populates the taglib map in three ways:
1. Explicit mapping, JSP container reads mapping entries which present in deployment descriptor
2. Implicit mapping, JSP container reads all taglib.tld file which present in the packaged JAR.
3. JSP container adds entries for the URIs that are known to the container by default.
Element <uri> in Tag Library Descriptor is used to implicit mapping. Example you have costum tag which packaged in a JAR.
JSP container will read that taglib.tld and make mapping taglib uri and taglib location.
Taglib uri is the value of element <uri> and Taglib location is the location of that JAR.
Hope this help you..
Correct me if i am wrong
regards
daniel
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic