users@glassfish.java.net

Re: How to deploy a WAR as the default application on the default server?

From: <Jan.Luehe_at_Sun.COM>
Date: Tue, 15 Apr 2008 20:31:04 -0700

glassfish_at_javadesktop.org wrote:

>In response to this entire thread, I'll also add that when deploying a web module as part of a larger enterprise module, Glassfish completely ignores the value specified in the context-root element in the sun-web.xml file. Instead it simply names its context-root as the name of the actual web module.
>
>

Well, have you thought of filing a bug?

  https://glassfish.dev.java.net/servlets/ProjectIssues

would be your best friend in this case.

>To top it off, Glassfish doesn't even give you the option of specifiying the bundled web module to be a default app. Therefore if it is in an enterprise module, you are stuck using the web module name as part of your URL to access any content contained within it.
>
>

Not entirely true.

After deploying your EAR, you can set any of its embedded WAR files as
the target virtual server's
default web module.

For example, after deploying mytest.ear with an embedded mywar.war to
the virtual server "server",
you can use this command to set the embedded mywar.war as the virtual
server's default web module:

  asadmin set
server.http-service.virtual-server.server.default-web-module=mytest#mywar.war

No server restart is required for this change to take effect.


Jan