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?
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"/>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With