Jan Luehe wrote On 03/16/07 03:43 PM,:
>
>
> glassfish_at_javadesktop.org wrote On 03/16/07 03:10 PM,:
>
>> Simple example.
>>
>> I have mywebapp.war.
>>
>> It gets deployed to: http://host/mywebapp
>>
>> Now, say I have an images directory on the file system (say
>> /usr/local/data/images), and inside that is img.gif.
>>
>> In GF1.x, can I do anything so that I can have a url like:
>> http://host/mywebapp/images/img.gif?
>>
>> Map that external directory within the URL space of my web app as if
>> the data we actually bundled with my WAR?
>>
>>
>
> Currently, we support this feature only for a virtual server's root
> context
> (docroot), via alternate docroot settings.
>
> See Item 4. (Alternate Docroots) at
>
> http://blogs.sun.com/jluehe/entry/virtual_hosting_features_in_glassfish
>
> and this forum thread:
>
> http://forums.java.net/jive/thread.jspa?messageID=207031
>
> We will support this feature for regular webapps as a future extension.
"Future" as in "now" (available in tonight's nightly v2 build). :)
Alternate docroots of a webapp are configured as properties in
sun-web.xml, using the same syntax as the virtual server properties
used for configuring alternate docroots for virtual servers.
I've attached the sun-web.xml of an imaginary webapp "myapp" deployed
at
http://<host>:<port>/myapp, which specifies exact, extension, and
path prefix URI patterns for the webapp's alternate docroots.
The exact matching pattern will map
http://<host>:<port>/myapp/my.jpg
to
/svr/images/jpg/my.jpg
while the extension and path prefix pattern will cause any requests of
the form:
http://<host>:<port>/myapp/*.jpg
and
http://<host>:<port>/myapp/jpg/*
respectively, to be served from this directory:
/svr/images/jpg
For example,
http://<host>:<port>/myapp/abc/def/my.jpg
will be mapped to:
/srv/images/jpg/abc/def/my.jpg
I am going to post a blog with more detailed info, but thought you
might be interested to learn about this feature sooner.
Jan