users@glassfish.java.net

Re: virtual directory?

From: Jan Luehe <Jan.Luehe_at_Sun.COM>
Date: Thu, 25 May 2006 10:10:12 -0700

Hi Kedar,

Kedar Mhaswade wrote On 05/24/06 18:15,:

> Hi Jan,
>
> Doesn't the directory need to be in a valid web application
> format like:
>
> - WEB-INF
> lib
> classes
>
> ...
>
> in order to be able to directory-deploy it?
>
> What if I just have static content to serve and don't want
> to create a web application/application structure? Shouldn't
> be as simple as tweaking virtual server doc-root etc.?
>
> Isn't this what Matt asking?


from Matt's Jboss example:

  <Context docBase='/net/stuff/Storage' path='/Storage' />

I assumed he wanted to be able to map a *user-specified* context root
("/Storage") to a *user-specified* directory path ("/net/stuff/Storage")
and serve (static) resources from that directory.

The approach I recommended works, but as you pointed out, there are
certain requirements on the directory layout, otherwise you get the
"Cannot determine the Java EE module type for" error during deployment.
Those requirements can be addressed easily by creating a WEB-INF
subdirectory with a dummy web.xml (a web.xml that contains an empty
<web-app>). It would be nice if this step weren't required, though.

In contrast, when you rely on a virtual server's docroot, your static
resources must not be prefixed by any context root in order to be mapped
to the virtual server's docroot, and they must be placed inside the
virtual server's docroot, which users generally don't have access to.


Jan

>
> Kedar
>
>
> Jan Luehe wrote:
>
>> Matt,
>>
>> Matthew Pease wrote On 05/24/06 17:22,:
>>
>>> Hi Jan -
>>>
>>> I guess I didn't phrase my question well... you didn't understand
>>> my question.
>>>
>>> What I need has nothing to do with deployment... it is a 100% http
>>> engine question.
>>>
>>> I want to map a certain URL, say myhost.com/content
>>>
>>> to serve files from a certain path on my webserver, say
>>> /home/matt/content_files
>>>
>>> Do you or does anyone out there have an idea how to do this?
>>
>>
>>
>>
>> When you do:
>>
>> asadmin deploydir --contextroot <myroot> <directory-path>
>>
>> the deployment code will add this entry to your domain.xml:
>>
>> <web-module availability-enabled="false" context-root="<myroot>"
>> directory-deployed="true" enabled="true"
>> location="<directory-path>"
>> name="<name>" object-type="user"/>
>>
>> and notify the web container of the new mapping, so that you can start
>> accessing your directory's resources like this:
>>
>> http://<host>:<port>/<myroot>
>>
>> Or is this not what you were asking about?
>>
>>
>> Jan
>>
>>>
>>> Thank you-
>>> Matt
>>>
>>> On 5/24/06, Jan Luehe <Jan.Luehe_at_sun.com> wrote:
>>>
>>>> Hi Matt,
>>>>
>>>> Matthew Pease wrote On 05/24/06 08:33,:
>>>>
>>>> > Hi all --
>>>> >
>>>> > I'd like to have a local raw content folder served from a certain
>>>> URL.
>>>> >
>>>> > how is this done on glassfish?
>>>> >
>>>> > How it is done with Jboss:
>>>> > http://www.jboss.org/index.html?module=bb&op=viewtopic&p=3829886
>>>> >
>>>> > <!-- Add a static context /Storage using directory
>>>> /net/stuff/Storage -->
>>>> > <Context docBase='/net/stuff/Storage' path='/Storage' />
>>>>
>>>>
>>>> GlassFish supports directory deployments. Please see:
>>>>
>>>> https://glassfish.dev.java.net/downloads/quickstart/index.html#ProcedureTo_Deploy_From_a_Development
>>>>
>>>>
>>>> for a start.
>>>>
>>>> Let me know if you still have any questions.
>>>>
>>>>
>>>> Jan
>>>>
>>>>
>>>> >
>>>> > Thank you-
>>>> > Matt
>>>> >
>>>> > ps. sorry to cross post here & the online BB... but I didn't get
>>>> > anything back from the BB.
>>>> >
>>>> >
>>>> ---------------------------------------------------------------------
>>>> > To unsubscribe, e-mail: users-unsubscribe_at_glassfish.dev.java.net
>>>> > For additional commands, e-mail: users-help_at_glassfish.dev.java.net
>>>> >
>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: users-unsubscribe_at_glassfish.dev.java.net
>>>> For additional commands, e-mail: users-help_at_glassfish.dev.java.net
>>>>
>>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe_at_glassfish.dev.java.net
>>> For additional commands, e-mail: users-help_at_glassfish.dev.java.net
>>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe_at_glassfish.dev.java.net
>> For additional commands, e-mail: users-help_at_glassfish.dev.java.net
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_glassfish.dev.java.net
> For additional commands, e-mail: users-help_at_glassfish.dev.java.net
>