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>
In my case, each server picked up its own property file whose name came from the system variable.
<bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
<property name="locations" value="classpath:/config/#{systemProperties['APPLICATION_PROPERTIES_FILE']}"/>
</bean>
After this, I had to add the property key via Spring JSTL expression e.g
class="org.springframework.security.oauth2.provider.token.store.JwtAccessTokenConverter">
<property name="signingKey" value="${oauth.signingkey}"/>
<property name="jwtClaimsSetVerifier" ref="OauthClaimVerifier"/>
</bean>