|
|
||
Amy Roh's BlogMay 2007 ArchivesContext (webapp) configuration in GlassFishPosted by amyroh on May 23, 2007 at 01:33 PM | Permalink | Comments (6)Deployment specific web application configuration using context.xml in GlassFish was added a couple of months ago but related questions keep coming up on mailing lists and forum so I've decided to blog about it so it's easy to point out. ;-) Similar to Tomcat you can define your context.xml as follows. 1. Global context.xml glassfish/domains/domain1/config/context.xml
which will be loaded by *all* webapps.
For example, global context.xml can define global environment entry to be shared across all webapps as follows.
<Context>
2. Virtual server context.xml specified by virtual-server property "contextXmlDefault" in domain.xml will be loaded by all webapps of this virtual server.
For examples, you can define contextXmlDefault for a virtual server in your domain.xml as follows.
<virtual-server id="server" ... >
3. Webapp specific context.xml will be loaded by this webapp only. You can define /META-INF/context.xml in a WAR file for this webapp specific environment and resource definitions.
<Context>
GlassFish V2 Beta 2 or later should have this feature. Cheers, Amy | ||
|
|