Injecting System Properties into Spring beans
DougBreaux 270007SMYJ Visits (17424)
This is an 'oldie', but I just needed it again, so I thought it worth describing.
The Spring framework has an easy way to externalize some of the properties of your bean definition files into a Java properties file, using a Prop
As I was looking to write this, I found a couple other articles with a lot of additional, useful information on the subject:
However, my immediate case is a simple one of using a "hardcoded" default property value with a System Property override. For that case, the Spring config looks something like this:
<!-- Property placeholders, overridable by System.properties -->