Configuration

The Framework is configured using java properties. Configuration properties for a specific applications usually live in the files WEB-INF/classes/service-config.properties and WEB-INF/classes/deploy-config.properties within the war-file. Properties can be placed in either of the two files. The purpose of the deploy-config file is to allow a second level of customisation, so a test instance of the application might use a different deploy-config file from the production version. Additional properties can also be set on the tomcat/JVM command line though these do not override any entries in the built-in configuration files. Properties can also be added the web.xml, context.xml files and to the Properties database table. Database Properties have a higher precedence than the configuration files so this table can be used to dynamically change the configuration of a running instance. This is the mechanism used by built-in administration forms to change the configuration. In most cases the top-level war-file will be built specialised for the site deploying the application. Properties are loaded from the following locations in order:
  1. Standard java properties including JVM -Dproperty=value flags.
  2. Two levels of configuration files. For each level a configuration property (that could be set in a previous level) can be used to specify a comma separated set of locations. These locations can either be resources on the java classpath or an absolute file-location.
    Location parameterDefault valueFiles must exist
    config.pathservice-config.propertiesyes
    deploy.pathdeploy-config.propertiesno
  3. Init parameters set in the Context or Servlet elements of the application XML files. Parameters set in the Servlet elements are only visible to requests to that servlet. Parameters in the Context are global. As a Context configuration can be set outside of the warfile this is a good mechanism for setting parameters without having to rebuild the war-file.
  4. Values in the Properties database table. The database connection must be fully configured by the previous sections.
If you want to override properties from the java command line the easiest way to do this is to use a JVM parameter to add an additional property file to the deploy.path and then add the override properties to that file: e.g.
-Ddeploy.path=deploy-config.properties,/etc/safe/safe.properties .