System Settings (Java Properties and Environment Variables)
Last updated
Last updated
ColdBox makes it easy to access the configuration stored in your Java system properties and your server's environment variables, even if you don't know which one it is in! Three methods are provided for your convenience:
config/ColdBox.cfc
or a ModuleConfig.cfc
If you are inside config/ColdBox.cfc
or a ModuleConfig.cfc
or a config/WireBox.cfc
you can use the three system settings functions directly! No additional work required.
Application.cfc
If you would like to access these methods in your Application.cfc
, create an instance of coldbox.system.core.util.Util
and access them off of that component. This is required when adding a datasource from environment variables.
Example:
If you need to access these configuration values in other components, consider adding the values to your and injecting the values into your other components
Name | Arguments | Description |
|
| Looks for |
|
| Returns the Java System property for |
|
| Returns the server environment variable for |