1, download a sample webapp, hello.war, from GlassFish web site, to $GLASSFISH_HOME/domains/domain1/autodeploy/ directory:
wget https://glassfish.dev.java.net/downloads/quickstart/hello.war2, verify hello.war has been successfully deployed:
cd $GLASSFISH_HOME/bin3,
./asadmin list-components
./asadmin set-web-env-entry --name=contact-email --value=info@examplexxx.com --type=java.lang.String hello4, verify the 2 new env-entry elements:
./asadmin set-web-env-entry --name=debug --value=true --type=java.lang.Boolean hello
./asadmin list-web-env-entry helloYou can also verify them by viewing $GLASSFISH_HOME/domains/domain1/domain.xml:
Reported 2 env-entry settings
contact-email (java.lang.String) = info@examplexxx.com ignoreDescriptorItem=false //(description not specified)
debug (java.lang.Boolean) = true ignoreDescriptorItem=false //(description not specified)
<application context-root="/hello" location="${com.sun.aas.instanceRootURI}/applications/hello/" name="hello" object-type="user">
<property name="defaultAppName" value="hello" />
<module name="hello">
<engine sniffer="security" />
<engine sniffer="web">
<web-module-config>
<env-entry>
<env-entry-type>java.lang.String</env-entry-type>
<env-entry-value>info@examplexxx.com</env-entry-value>
<env-entry-name>contact-email</env-entry-name>
</env-entry>
<env-entry>
<env-entry-type>java.lang.Boolean</env-entry-type>
<env-entry-value>true</env-entry-value>
<env-entry-name>debug</env-entry-name>
</env-entry>
</web-module-config>
</engine>
</module>
</application>
To learn more about set-web-env-entry subcommand, try one of the following:
./asadmin help set-web-env-entryTo list and unset env-entry, use the following asadmin commands:
./asadmin set-web-env-entry --help
The same feature also exists for web context-param, via the following commands:
list-web-env-entry
unset-web-env-entry
list-web-context-param
set-web-context-param
unset-web-context-param