WebSphere variables

WebSphere variables are name and value pairs that are used to provide settings for any of the string data type attributes that are used to configure the product. After a variable is defined, the symbolic name that is specified for that variable can be specified in the Value field of any other configuration field for the product that accepts a string value.

WebSphere variables can be used to configure:
  • WebSphere® Application Server path names, such as JAVA_HOME, and APP_INSTALL_ROOT
  • A path value for the extendedDocumentRoot JSP or file serving attribute. This capability enables you to add an application to each node in a clustered environment without modifying the ibm-web-ext.xmi file for that application on each node.
    支援的配置 支援的配置: 對於 IBM® 延伸和連結檔而言,.xmi 或 .xml 副檔名取決於您是使用 Java EE 5 之前的應用程式或模組,或 Java™ EE 5 或更新版本的應用程式或模組。 IBM 延伸或連結檔稱為 ibm-*-ext.xmi 或 ibm-*-bnd.xmi,其中 * 是延伸或連結檔的類型,例如:app、application、ejb-jar 或 web。 適用的條件如下:
    • 如果應用程式或模組使用第 5 版之前的 Java EE,副檔名必須是 .xmi。
    • 如果應用程式或模組使用 Java EE 5 或更新的版本,副檔名必須是 .xml。 如果 .xmi 檔是隨附在應用程式或模組,則本產品會忽略 .xmi 檔。

    不過,即使應用程式含有 Java EE 5 之前的檔案,且所用的副檔名是 .xmi,其中也可以有 Java EE 5 或更新版本的模組。

    ibm-webservices-ext.xmiibm-webservices-bnd.xmiibm-webservicesclient-bnd.xmiibm-webservicesclient-ext.xmiibm-portlet-ext.xmi 檔會繼續使用 .xmi 副檔名。

    sptcfg
  • Certain cell-wide customization values
  • [z/OS]The location service for the z/OS platform.
When a variable is defined, it is given a scope. The scope is the range of locations within the product network where the variable is applicable.
  • A variable with a cell-wide scope is available across the entire deployment manager cell.
  • A variable with a cluster-wide scope is available across the entire cluster in the cell.
  • A variable with a node-level scope is available only on the node and the servers on that node. If a node-level variable has the same name as a cell-wide variable, the node-level variable value takes precedence.
  • A server variable is available only on the one server process. A server variable takes precedence over a variable with the same name that is defined at a higher level.

The value of a configuration attribute can contain references to one or more variables. The syntax for such an attribute is the name of the variable, enclosed in either a pair of curly braces { } or a pair of parenthesis ( ). In either case, the variable is proceeded by the dollar sign.

A string configuration attribute value can consist of:
  • String literals, including the null value and an empty string
  • Variable references that each includes one or more levels of indirection
  • Nested variable references.
  • Any combination of non-null and non-empty string literals, variable references, and nested variable references.

[Windows]For Microsoft Windows operating systems, the specified file paths are prefixed wth /Program Files.

Table 1. WebSphere variables and attributes . The following table illustrates all of the possible combinations.
Configuration attribute consists of: Configuration attribute value Variable name Second variable value Third variable value Fourth variable value Expanded configuration attribute value
String literal /IBM/WebSphere/AppServer N/A N/A N/A N/A /IBM/WebSphere/AppServer
Variable reference $(WAS_ INSTALL_ ROOT) WAS_ INSTALL_ ROOT /IBM/WebSphere/AppServer N/A N/A /IBM/WebSphere/AppServer
Variable reference with a string literal $(USER_ INSTALL_ ROOT)/temp USER_ INSTALL_ ROOT N/A N/A /IBM/WebSphere/AppServer/profiles/AppSrv01 /IBM/WebSphere/AppServer/profiles/AppSrv01/temp
Indirect variable reference with a string literal $(WAS_ INSTALL_ ROOT)/lib WAS_ INSTALL_ ROOT $(MY_INSTALL_ ROOT) MY_INSTALL_ ROOT N/A N/A
Nested variable references with string literal (Example 1) $(${INSTALL_ TYPE}_ INSTALL_ ROOT)/lib INSTALL_ TYPE USER USER_INSTALL_ ROOT /IBM/WebSphere/AppServer/profiles/AppSrv01 /IBM/WebSphere/AppServer/profiles/AppSrv01/lib
Nested variable references with string literal (Example 2) $(${INSTALL_ TYPE}_ INSTALL_ ROOT)/lib INSTALL_ TYPE WAS WAS_INSTALL_ ROOT /IBM/WebSphere/AppServer/AppServer /IBM/WebSphere/AppServer/AppServer/lib

During the configuration process, whenever a variable is encountered as the value for a configuration attribute, a variable expansion is performed on that variable. A variable expansion is the process of recursively replacing variable references with variable values until only a string literal remains as the value for the configuration attribute. If the expansion process encounters a variable that is not properly defined, the expansion of that variable stops and a VariableExpansionException exception is issued. The product configuration process continues. However, processing errors might occur because the value for this configuration attribute is not properly established.

避免困難 避免困難: The variable expansion syntax that consists of a dollar sign, and a single letter variable name without any surrounding braces or parenthesis, is not supported. All WebSphere variable references must be surrounded by matching parenthesis or braces, even if it is a single letter. That syntax required escaping of dollar signs to avoid ambiguity.gotcha
Table 2. Literal dollar sign . For backward compatibility, the escaping of the literal dollar sign is still supported, and the literal dollar sign is interpreted as indicated in the following table.
Input value Value after expansion
$ $
$$ $
$$$ $$
$$$$ $$
$$$$$ $$$

指出主題類型的圖示 概念主題



時間戳記圖示 前次更新: July 9, 2016 11:10
http://www14.software.ibm.com/webapp/wsbroker/redirect?version=cord&product=was-nd-mp&topic=ccws_variable
檔名:ccws_variable.html