dev@glassfish.java.net

Re: HEADS-UP: default-web-module optimization

From: Jan Luehe <Jan.Luehe_at_Sun.COM>
Date: Wed, 30 Aug 2006 17:11:11 -0700

Jerome Dochez wrote On 08/30/06 16:33,:

> Jan Luehe wrote:
>
>>
>>
>> Bill Shannon wrote On 08/30/06 13:04,:
>>
>>> Jan Luehe wrote:
>>>
>>>>
>>>>
>>>> Bill Shannon wrote On 08/30/06 00:18,:
>>>>
>>>>> It seems weird that a web app would be deployed both with a regular
>>>>> context root ("/asadmin") and with a context root of "/". Is that
>>>>> just a side effect of the current implementation? Wouldn't it be
>>>>> more natural to deploy a web app once, as the default web app, at
>>>>> the context root of "/"?
>>>>
>>>>
>>>>
>>>>
>>>>
>>>> The current impl deploys a webapp that is referenced as a
>>>> default-web-app twice: once at its orginal context root ("/asadmin"),
>>>> and a *copy* of it at "/".
>>>>
>>>> The proposed changes will deploy it only once, but will have it
>>>> serve both "/" and "/asadmin".
>>>
>>>
>>>
>>> I guess my question is, what's the motivation for having a single
>>> web app serve two different context roots? Wouldn't it be more
>>> common for a special default web app to serve "/" and other web
>>> apps (if any) to serve other context roots?
>>
>>
>>
>> By declaring a web module as a default-web-module, you "promote" it
>> and give it higher visibility: You can access it without even knowing
>> its name, just by accessing "/", which, when you access the GlassFish
>> admin port, will give you the "admingui". But you could also access the
>> admingui via its configured context root "/asadmin".
>>
>> You can change a virtual server's default-web-module as you please
>> (and your updates will take effect immediately). When you do that, you
>> can select among any of the web modules already deployed on the
>> virtual server. Say you've deployed web module "123" at "/123", and
>> you now want to make it the virtual server's default-web-module. The
>> web module will now be available at "/", in addition to "/123" (removing
>> it from "/123" would have required an undeploy).
>
> But if you could replace the internal mapping from /123 to /, you
> would not need this trick. The /123 would still be valid since the
> default webapp behaviour would kick in. Could you clarify why there is
> a need for undeployment in order to change the internal mapping of a
> web application ?


I never said I've replaced the internal mapping from "/123" to "/". ;-)

When you declare "123" as your default-web-module, the proposed change
has the
mapper map any requests that can't be mapped to any of the deployed
contexts to
"/123", but it does not "replace" anything.

You can't just switch back and forth between "/" and "/123", which you
would do
if you replaced "/123" with "/".

Some internals (such as the per-context jacc policies) rely on the
context path
that was used (and visible) during deployment. They expect a context path to
remain in effect until they've received a corresponding undeploy event
for that
context path.

Assume a default-web-module "123" with a context root of "/123" and a
resource "/test".
When receiving a request for "/test", the proposed change will make it
*appear* to the
container as if the request had been for "/123/test", so any security
decisions or other
kinds of decisions can continue to be based on the "/123" context root
that was
"advertised" during the deployment of "123".


Jan



>>
>> The semantics of default-web-module, as described above, have been
>> around
>> for a long time (I believe since iAS7), which is why we need to
>> preserve them.
>>
>>
>> Jan
>>
>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: dev-unsubscribe_at_glassfish.dev.java.net
>>> For additional commands, e-mail: dev-help_at_glassfish.dev.java.net
>>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: dev-unsubscribe_at_glassfish.dev.java.net
>> For additional commands, e-mail: dev-help_at_glassfish.dev.java.net
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe_at_glassfish.dev.java.net
> For additional commands, e-mail: dev-help_at_glassfish.dev.java.net
>