users@glassfish.java.net

Re: Can I mapping an external directory to appear within the webapp?

From: Jan Luehe <Jan.Luehe_at_Sun.COM>
Date: Wed, 21 Mar 2007 18:58:18 -0700

>>
>> 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?
>>>
>>

This is supported as of GlassFish v2, build 40.

See

  http://blogs.sun.com/jluehe/entry/alternate_docroots_in_web_applications

for details.


Jan