You are viewing a plain text version of this content. The canonical link for it is here.
Posted to taglibs-user@tomcat.apache.org by Ben Anderson <st...@hotmail.com> on 2003/11/28 17:05:32 UTC

well-known URI's

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

_________________________________________________________________
Need a shot of Hank Williams or Patsy Cline?  The classic country stars are 
always singing on MSN Radio Plus.  Try one month free!  
http://join.msn.com/?page=offers/premiumradio


---------------------------------------------------------------------
To unsubscribe, e-mail: taglibs-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: taglibs-user-help@jakarta.apache.org


Re: well-known URI's

Posted by Kris Schneider <kr...@dotech.com>.
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 <st...@hotmail.com>:

> 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 <ma...@dotech.com>
D.O.Tech       <http://www.dotech.com/>

---------------------------------------------------------------------
To unsubscribe, e-mail: taglibs-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: taglibs-user-help@jakarta.apache.org