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>
精彩评论