well the format: <taglib ... > ... <uri>someURIexample</uri> <tag> ... ... </tag> </taglib> is used in .tld file . this kind of mapping is called implicit mapping(which is preferred as it requires less configuration). to refer to a tag from this file we would use: <%@taglib uri="someURIexample" prefix="myPrefix" %> ========================================================== whereas the format below is used in Deployment Descriptor(web.xml) <jsp-config> .... <taglib> <taglib-uri>myTags</taglib-uri> <taglib-location>/WEB-INF/myTags.tld</taglib-location> </taglib> .... </jsp-config>
this kind of mapping is called explicit mapping. to refer to a tag from this tld we would use: <%@taglib uri="myTags" prefix="myPrefix" %>
However note that: explicit mapping takes precedence over implicit mapping, therefore if the uri element in first case and taglib-uri in second case have the same content, always the explicit mapping is used.
Thanks Ash, it is very useful to know about the explicit mapping and implicit mapping.
But as per i know the <uri> name should be unique for a web-application.According to you we can use same <uri> for implicit mapping as well as explicit mapping.Does it not violate its uniqueness ??? please correct me if i am wrong.
well, i tried using the same uri in taglib-uri element of web.xml and in uri element of a .tld file (am using Tomcat 6). Didnt get any errors .My observation was: the tag pointed by taglib-uri was given preference over the tag pointed by uri element of .tld file. Thus i observed that explicit mapping was preferred over implicit mapping, no errors when same uris were used.