The external substitution file

In addition to adding placeholders to configuration files, you must create and populate the external file that holds the values for the placeholders. The external substitution file holds only single line entries of name/value pairs.
Important: It is possible to set system configuration properties from a command prompt as you start the application server. However, if you are using external server configuration, do not attempt to set configuration parameters through the use of system properties from a command prompt.

Populating the substitution file

Each group of configuration files that support substitution has a unique namespace value. You must incorporate the file group namespace into each name/value entry in the external substitution file. Use the following syntax for each entry in this file.
  • namespace.key=substitutionValue

You can give the external substitution file any name that you want.

Example

For example, file database-config.xml contains a <dbcp-connection-pool> element with a jdbc-url attribute. Suppose that you want to provide a value at server start for this URL. Creating a placeholder for a configuration file is a multi-step process:

  1. Replace the jdbc-url="..." attribute string in file database-config.xml with ${jdbc_url}. Thus, the jdbc-url entry in database-config.xml looks similar to the following example:
    • <dbcp-connection-pool jdbc-url=${jdbc_url} />
  2. Make an entry for the jdbc-url placeholder in the external substitution file that looks similar to the following entry:
    • database.jdbc_url="someURL"
After the Substitutor process makes the substitution for the placeholder, the <dbcp-connection-pool> element looks similar to the following example:
  • <dbcp-connection-pool jdbc-url="someURL" />

Identifying the substitution file

Set the path to substitution file using the following system property command as you start the server:
  • gw.config.external.property.file=filename
However, to use this system property with the gwb runServer command, you must use the following construction:
  • gwb runServer -Dgw.passthrough.key=value
The following example illustrates this concept.
  • gwb runServer -Dgw.passthrough.gw.config.external.property.file="C:\cc10\configuration\etc\ext-properties.properties"