есть property файл со следующим содержимым
client.properties
файл:
id=1
name=John Smith
greeting=hello there!
Использую его в определении бинов:
<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>
Теперь я хочу подключить еще 1 property файл с такими же клячами, но разынми значениями
annotatedClient.properties
:
id=2
name=Vasiliy
Как их правильно различать?
делаю следующим образом:
<property name="locations">
<list>
<value>classpath:client.properties</value>
<value>classpath:annotaitedClient.properties</value>
</list>
</property>
так выбрасывается 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>
так читается только файл annotaitedClent.properties
:
<bean class="Client" id="client">
<constructor-arg value="${id}"/>
<constructor-arg value="${name}"/>
<property name="greeting" value="${greeting}"/>
</bean>