2.8.16 set-web-context-param
Sets a servlet context-initialization parameter of a deployed Web application or module.
Synopsis
asadmin [asadmin-options] set-web-context-param [--help] --name=context-param-name {--value=value|--ignoredescriptoritem={false|true}} [--description description] application-name[/module]
Storage location
Application Server installation directory/javaee/glassfish/bin
Function
The set-web-context-param subcommand of asadmin sets a servlet context-initialization parameter of 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 a servlet context-initialization parameter of 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=context-param-name
-
Specifies the name of the servlet context-initialization parameter that is to be set.
Type: String
The following values can be specified:
-
Name of the parameter
Default value: N/A
-
- --value=value
-
Specifies the value to which the servlet context-initialization parameter is to be set.
Either the --value option or the --ignoredescriptoritem option must be set.
Type: String
The following values can be specified:
-
Value of the parameter
Default value: N/A
-
- --ignoredescriptoritem={false|true}
-
Specifies whether the servlet context-initialization parameter is ignored if it is set in the application's DD. When a parameter is ignored, the application behaves as if the parameter had never been set in the application's DD. The behavior of an application in this situation depends on the application.
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 a servlet context-initialization parameter that has previously been set by using the set-web-context-param subcommand. Instead, use the unset-web-context-param subcommand for this purpose.
Default value: false
-
- --description description
-
Specifies an optional textual description of the context parameter that is being set.
Type: String
The following values can be specified:
-
Description of the environment entry
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 servlet context-initialization parameter 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 servlet context-initialization parameter javax.faces.STATE_SAVING_METHOD of the web application basic-ezcomp to client. The description The location where the application's state is preserved is provided for this parameter.
asadmin set-web-context-param --name=javax.faces.STATE_SAVING_METHOD --description "The location where the application's state is preserved" --value=client basic-ezcomp
Exit Status
Exit Status |
Explanation |
---|---|
0 |
command executed successfully. |
1 |
error in executing the command. |