dev@glassfish.java.net

strange interaction that surprised me

From: Vince Kraemer <vince.kraemer_at_oracle.com>
Date: Fri, 18 Feb 2011 16:36:10 -0800

I ran into this while doing some testing of a fix for the NB plugin...

I am using GlassFish Server 3.1 promoted build 43...

Consider that you have a web app packaged in bar.war. It does not
contain a glassfish-web.xml file OR a sun-web.xml.

If you `asadmin deploy --force=true bar.war`, the app gets deployed and
the context root is something like http://localhost:8080/bar.

If you `asadmin deploy --force=true --contextroot="foo" bar.war`, the
app gets deployed and the context root is something like
http://localhost:8080/foo.

If you do `asadmin deploy --force=true --contextroot="foo" bar.war` and
then do `asadmin deploy --force=true bar.war`, what do you think the URL
to your web app will be?

It ends up being http://localhost:8080/foo.... Which makes some sense...
but is likely to be unexpected, too. It caught me by surprise.

vbk