Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

This means if a property appears in the External.properties file it will be read last and the setting for that property will be that which is set in External.properties.  This is meant to provide a means for configuration to be set by a variety of different people.  For instance if your application is going to only be used in known environments then those environments can be configured in config.xml and which environment the application is in can be determined by External.properties which resides in $CATALINA_HOME and never needs to be reset.  If your application is going to be used in environments that are unknown the it makes sense for the application to be completely configured by External.properties and possibly reasonable defaults placed in either SGProperties or in config.xml.  Any time properties need to be available from without the application it makes sense to have them configured in External.properties.

 

...

Behavioral differences

MethodParameter formatLookup failure behaviorUsage example

ClassLoader.

getResourceAsStream()

"/"-separated names; no leading "/" (all names are absolute)Silent (returns null)

this.getClass().getClassLoader()

.getResourceAsStream

("some/pkg/resource.properties")

Class.

getResourceAsStream()

"/"-separated names; leading "/" indicates absolute names; all other names are relative to the class's packageSilent (returns null)

this.getClass()

.getResourceAsStream

("resource.properties")

ResourceBundle.

getBundle()

"."-separated names; all names are absolute;.propertiessuffix is implied

Throws unchecked

java.util.MissingResourceException

ResourceBundle.getBundle

("some.pkg.resource")