There is a property file with the following contents
client.properties file:
id=1 name=John Smith greeting=hello there! I use it in the definition of bins:
<bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"> <property name="locations"> <list> <value>classpath:client.properties</value> </list> </property> </bean> <bean class="Client" id="client"> <constructor-arg value="${id}"/> <constructor-arg value="${name}"/> </bean> Now I want to connect another 1 property file with the same nags, but different values
annotatedClient.properties :
id=2 name=Vasiliy How to distinguish between them?
do as follows:
<property name="locations"> <list> <value>classpath:client.properties</value> <value>classpath:annotaitedClient.properties</value> </list> </property> so is exeption (
Could not resolve placeholder 'client.id' in string value "$ {client.id}"
):
<bean class="Client" id="client"> <constructor-arg value="${client.id}"/> <constructor-arg value="${client.name}"/> <property name="greeting" value="${greeting}"/> </bean> only annotaitedClent.properties file is read annotaitedClent.properties :
<bean class="Client" id="client"> <constructor-arg value="${id}"/> <constructor-arg value="${name}"/> <property name="greeting" value="${greeting}"/> </bean>