Is there a way to set a property of a bean in a Spring configuration file to that of a string read from a Properties file?
e.g.
<bean id="...." class="....">
<property name="loginURL">GET_THIS_VALUE_FROM_'ENV.PROPERTIES'_FILE</property>
</bean>
You should be able to use a PropertyPlaceHolderConfigurer to load a properties file, and then refer to the properties using an Spring-EL expression -
<context:property-placeholder location="classpath:custom.properties"/>
<bean id="...." class="....">
<property name="loginURL">${propname}</property>
</bean>
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