Oracle GlassFish Server 3.0.1 Application Deployment Guide

ProcedureTo Set a Web Environment Entry

An application uses the values of environment entries to customize its behavior or presentation. Use the set-web-env-entry subcommand in remote mode to change the configuration of a deployed application without the need to modify the application's deployment descriptors and repackage and redeploy the application. By using this subcommand, you are either adding a new parameter that did not appear in the original web module's descriptor, or overriding the descriptor's setting of the parameter.

If you the --ignoreDescriptorItem option is set to true, then the server ignores any setting for that environment entry in the descriptor, which means you do not need to specify an overriding value on the set-web-env-entry subcommand. The server behaves as if the descriptor had never contained a setting for that environment entry.

This subcommand sets an environment entry for one of the following items:

Before You Begin

The application must already be deployed. Otherwise, an error occurs.

  1. Ensure that the server is running.

    Remote commands require a running server.

  2. Set an environment entry for a deployed web application or module by using the set-web-env-entry(1) subcommand.

    Information about the options for the subcommand is included in this help page.

Example 2–24 Setting an Environment Entry for a Web Application

This example sets the environment entry Hello User of the application hello to techscribe. The Java type of this entry is java.lang.String.

asadmin> set-web-env-entry --name="Hello User"
--type=java.lang.String --value=techscribe
--description="User authentication for Hello appplication" hello
Command set-web-env-entry executed successfully

See Also

You can also view the full syntax and options of the subcommand by typing asadmin help set-web-env-entry at the command line.