Using system properties in config files
When JBoss reads in XML configuration files and deployment descriptors, it performs variable substitution using the values of system properties in the form of ${property.name} . In addition to the normal Java sytem properties like java.io.tmpdir, JBoss provides its own properties such jboss.server.name and jboss.bind.address.
As with all Java system properties, you can use the -Dproperty=value flag to set or override values for properties. For example:
[nr@rubik] % run.sh -Dhttp.port=80 default
If the named system property doesn't exist, no expansion is done. For example, if there is no foo.bar system property defined, a config file with the text ${foo.bar} will simply yield the value ${foo.bar} .
Since JBoss 4.0, you can specify a default value if the property is not set (among other features). As an example: $ , if prop is not defined then default is used. See the JavaDoc for StringPropertyReplacer.
Comments