Marc Hedlund wrote:

> In section 2.7.7, "The taglib directive," the spec says that the taglib
> directive contains an "uri" attribute where the taglib can be found.
> Does this imply that a taglib must be network-accessible for the JSP
> engine to use it?  If so, why?  Shouldn't a taglib also be available using
> a "file" attribute containing a relative URL spec, just as in the include
> directive?
>

File pathnames are a subset of URIs, when you add the "file:" scheme on the
front.  For example, you can have something like this (modifying the example in
Section 2.7.7):

    <%@ taglib uri="file:/path/to/supertags" prefix="super />

without needing to introduce an alternative attribute.  There's no requirement
that your tag library be accessible from a web server (that is, have a URI that
starts with "http:").

The URLStreamHandler mechanism in Java is also very nicely extensible -- you
can create your own handlers for custom scheme prefixes (instead of "file:",
"http:", and "ftp:" which are supported by the basic JVM) to retrieve the tags
from someplace else (perhaps in a database accessed via JDBC, or an RMI remote
server, or whatever).

>
> I would propose that the taglib directive require either an "uri"
> attribute or a "file" attribute, so that the taglib can be found on the
> filesystem and be consistent with includes.
>

Because you can reference files with URIs, I don't see any need for the
duplication.

Craig McClanahan

===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff JSP-INTEREST".  For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".

Reply via email to