Reputation: 91850
I need to inject a java.utils.Properties
instance into one of my beans. Is there a Spring class which will load the properties file and convert it into a java.utils.Properties
instance, ready for injection?
Upvotes: 4
Views: 7103
Reputation: 403601
Yes, using <util:properties>
(see documentation).
Example:
<!-- creates a java.util.Properties instance with values loaded from the supplied location -->
<util:properties id="jdbcConfiguration" location="classpath:com/foo/jdbc-production.properties"/>
Upvotes: 11