> For Apache JServ, I am not going to assume that the resource request MUST
> resolve to a file path. The plan is to provide a configuration parameter
> (call it the "resource base") for a servlet context that tells the context
> where to get the requested resources from. For example, if the resource base
> is set to
>
> file:///usr/local/apache/share/htdocs
>
> then your getResource() example would return a URL for
>
> file:///usr/local/apache/share/htdocs/docs/fred.HTML
>
> which would end up (when you call URL.openConnection() on it) reading the file
> directly. Presumably the specified directory is the document root for your
> web server, but it doesn't have to be. You also cannot assume that the file
> path really retrieves the same resource you would get by asking the web server
> to get /docs/fred.HTML because the web server.
>
> On the other hand, if the resource base were set to:
>
> http://www.mycompany.com/resources
>
> then the example would resolve to a URL object for:
>
> http://www.mycompany.com/resources/docs/fred.HTML
>
> instead. When you use the openConnection() call on such a URL, you will
> retrieve the referenced resource through an HTTP connection to the specified
> web server (which could be anywhere on your network), instead of reading it
> from the filesystem.
This was exactly how it was intended to be used. Note that one can add
your own protocol handlers to the mix to allow resources to be fished
out of a database, a JNDI namespace, or whatever.
.duncan
___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".
Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html