Feb 6th, 2013, 05:29 PM
Controlling data source for property injection (@Value)
Currently, @Value annotated fields retrieve their values from system properties at some point during Spring context initialization.
I would like to know if there was a way to either:
1) dictate where those values are retrieved (e.g., from someplace else other than system properties), or
2) if that's not possible, inject something into the Spring lifecycle such that I could read my properties from someplace else and then add them to the system properties.
For #2, we have a settings server defined in our Spring XML we would like to hit to retrieve these values. The key would be to have the settings server bean defined but prior to Spring processing the @Value annotations.
Any assistance will be welcome, thanks.
Tags for this Thread