Spring Framework property management

István Soós March 02, 2011 1 min read

The original article here described a complex way to enable this feature in earlier Spring Framework versions. Since Spring 3.1, there is a unified property management that does exactly that, and I’ve removed the original content for clarity.

I think the most usefule part of the property management is the following configuration setting:

<beans>
    <import resource="some/enterprise/service/${environment}-config.xml"/>
</beans>

It enables us to define environments separately, like:

And for each of these environments, you may use your specific implementation, settings and wiring.

It important to note that in the latest versions of Spring, you can achieve similar effect with class- and annotation-based configuration.

updated: August 29, 2014
István Soós
software engineer, business advisor
Advocates for the maker-movement, self-directed learning and agile methods. His regular topics include: machine intelligence, data and risk analysis, distributed systems and knowledge management.