The key to having your tag library work without a web.xml <taglib> element is to
use the <uri> element in your TLD file (<uri> is an optional sub-element of the
top-level <taglib> element). Using JSTL 1.0 as an example, the "c.tld" file
contains:

...
<taglib>
  ...
  <uri>http://java.sun.com/jstl/core</uri>
  ...
</taglib>

So, if a JSP contains a directive like:

<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core"; %>

where the "uri" attribute value matches the <uri> body, then the tag library
will be located successfully (assuming everything has been packaged and
installed correctly).

The idea behind well-known URIs is that a container may optionally provide an
alternate (and hopefully optimized) implementation of certain tag libraries.
Each container decides which, if any, to provide. For example, I believe Resin
has incorporated an implementation of JSTL into its container. This doesn't
really have anything to do with the ability to use your own taglib without a
web.xml <taglib> element.

Quoting Ben Anderson <[EMAIL PROTECTED]>:

> Hello,
> I'm not clear on how "well-known" URI's are defined.  The specifications 
> don't seem to have much info on this.  I'm wondering if it is possible for 
> my own custom tag library to be used without specifying the <taglib> in the
> 
> web.xml.
> Thanks,
> Ben

-- 
Kris Schneider <mailto:[EMAIL PROTECTED]>
D.O.Tech       <http://www.dotech.com/>

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to