tomcat-taglibs-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Rashmi Rubdi <>
Subject Re: uri question..
Date Sun, 10 Sep 2006 21:21:44 GMT
I think <%@ taglib prefix="c" uri="" %>
  is a namespace declaration. 
  With this declaration the namespace prefix is associated with the namespace uri so that
the tag processor knows how to handle a JSTL tag when it comes accross it in the JSP page.

  Namespace prefixes are necessary for a few reasons and one of them is that they allow the
processor to distinguish between tags that have the same name but belong to different tag
libraries, and having different implementation.
  For example there can be 
  <c:out value="${myValue}" />
  <x:out select="$abook/title"/>
  Here , the action - out is distinguished by using the namespace prefixes c or x. 

maya <> wrote:

I have been studying taglibs and beans for days now, and am still 
confused about some things, but for now a simple question (I hope..) re uri:

let's take JSTL.. the jstl.jar for my app is here..


yet the uri for it in taglib directive in JSP (and in tag in tld) is

how does the container find the classes in /WEB-INF/lib/jstl.jar when 
the uri points to an outside url? (and the classes are not at this url 

hope this question makes sense.. in oreilly (JSP, 3rd ed, ch7) it says 
the 'uri' attr in taglib directive in JSP is there to find "the class or 
tag file for each custom action."
Then in the very next sentence it says, "the attribute contains a string 
the container uses to locate the TLD for the library.." but it points to 
a uri for the classes, right? (or tag files..) not the tld..

(and come to think of it, why is this necessary at all, since the 
element in the tld always has a reference to the class (like the web.xml 
for servlets always contains a ref to the servlet class..) and if using 
tag files like this:



so, what exactly is the point of the uri and what DOES it point to 
really? thank you..


To unsubscribe, e-mail:
For additional commands, e-mail:

Stay in the know. Pulse on the new  Check it out. 
  • Unnamed multipart/alternative (inline, 8-Bit, 0 bytes)
View raw message