2.8.17 set-web-env-entry
Sets an environment entry for a deployed Web application or module.
Synopsis
asadmin [asadmin-options] set-web-env-entry [--help] --name=env-entry-name --type=env-entry-type {--value=value|--ignoredescriptoritem={true|false}} [--description description] application-name[/module]
Storage location
Application Server installation directory/javaee/glassfish/bin
Function
The set-web-env-entry subcommand of asadmin sets an environment entry for one of the following items:
-
A deployed Web application.
-
A Web module in a deployed Java Platform, Enterprise Edition (Java EE) application.
This subcommand enables you to change the configuration of a deployed application without the need to modify the application's DD and repackage and redeploy the application.
This subcommand is supported in remote mode only.
The DAS or server instance must be restarted to set an environment parameter entry for the deployed application.
Precondition
-
Domain Administration Server (DAS) is running.
-
The application must already be deployed.
Files
The path to the module is specified in the module element of the application's application.xml file.
Arguments
- --help | -?
-
Displays the help text for the subcommand.
- --name=env-entry-name
-
Specifies the name of the environment entry that is to be set. The name is a JNDI name relative to the java:comp/env context. The name must be unique within a deployment component.
Type: String
The following values can be specified:
-
Name of the environment entry
Default value: N/A
-
- --type=env-entry-type
-
Specifies the fully-qualified Java type of the environment entry value that is expected by the application's code.
Type: String
The following values can be specified:
-
java.lang.Boolean
-
java.lang.Byte
-
java.lang.Character
-
java.lang.Double
-
java.lang.Float
-
java.lang.Integer
-
java.lang.Long
-
java.lang.Short
-
java.lang.String
Default value: N/A
-
- --value=value
-
Specifies the value to which the environment entry is to be set.
-
If the --type is java.lang.Character, the value must be a single character. Else, the value must be a string that is valid for the constructor of the specified type.
-
Either the --value option or the --ignoredescriptoritem option must be set.
Type: String
The following values can be specified:
-
Value of the environment entry
Default value: N/A
-
- --ignoredescriptoritem={true|false}
-
Specifies whether the environment entry is ignored if it is set in the application's DD.
Type: Boolean
The following values can be specified:
-
false
The value is not ignored. This is the default value.
-
true
The value is ignored. Either the --value option or the --ignoredescriptoritem option must be set.
Do not use the --ignoredescriptoritem option to unset an environment entry that has previously been set by using the set-web-env-entry subcommand. Instead, use the unset-web-env-entry subcommand for this purpose.
Default value: false
-
- --description description
-
Specifies an optional textual description of the environment entry that is being set.
Type: String
The following values can be specified:
-
Description of the parameter
Default value: N/A
-
- application-name
-
Specifies the name of the application. This name can be obtained by using the list-applications subcommand.
Type: String
The following values can be specified:
-
Name of the application
Default value: N/A
-
- module
-
Specifies the relative path to the module within the application's enterprise archive (EAR) file. The path to the module is specified in the module element of the application's application.xml file. module is required only if the environment entry applies to a Web module of a Java EE application. The module would be specified as the operand of this command as myApp/myWebModule.war.
The module must follow application-name, separated by a slash (/).
Type: String
The following values can be specified:
-
Name of the module in the application
Default value: N/A
-
Examples
The following 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 application" hello
Exit Status
Exit Status |
Explanation |
---|---|
0 |
command executed successfully. |
1 |
error in executing the command. |