The following guidelines apply to deploying a web module in GlassFish Server:
Context Root. When you deploy a web module, if you do not specify a context root, the default is the name of the WAR file without the .war extension. The web module context root must be unique within the server instance.
The domain administration server (DAS) in GlassFish Server versions 2.1.1 and later supports the deployment of multiple web applications using the same web context root as long as those applications are deployed to different GlassFish Server stand-alone instances. Deploying multiple applications using the same context root within a single instance produces an error.
Data Source. If a web application accesses a DataSource that is not specified in a resource-ref in glassfish-web.xml, or there is no glassfish-web.xml file, the resource-ref-name defined in web.xml is used. A warning message is logged, recording the JNDI name that was used to look up the resource.
Virtual Servers. If you deploy a web application and do not specify any assigned virtual servers, the web application is assigned to all currently-defined virtual servers with the exception of the virtual server with ID __asadmin, which is reserved for administrative purposes. If you then create additional virtual servers and want to assign existing web applications to them, you must redeploy the web applications.
HTTP Sessions. If a web application is undeployed, all its HTTP sessions will be invalidated and removed, unless the application is being undeployed as part of a redeployment and the --keepstate deployment option was set to true. This option is not supported and ignored in a clustered environment. See Example 2-6.
For information about HTTP session persistence, see the Oracle GlassFish Server 3.1-3.1.1 High Availability Administration Guide.
Load Balancing. See the Oracle GlassFish Server 3.1-3.1.1 High Availability Administration Guide for information about load balancing.
<glassfish-web-app> ... <jsp-config> <property name=keepgenerated value=true /> </jsp-config> </glassfish-web-app>
If you include this property when you deploy the WAR file, the generated source is kept in domain-dir/generated/jsp/app-name/module-name for an application, or domain-dir/generated/jsp/module-name for an individually-deployed web module.
For more information about JSP precompilation, see jsp-config.
Web Context Parameters. You can set web context parameters after deployment. See the following sections:
Web Environment Entries. You can set web environment entries after deployment. See the following sections: