I am facing a simple problem here. I have two properties files I want to read to create two datasources. Yet those properties files have exactly the same keys! I am able to read both the files using:
<context:property-placeholder
location="classpath:foo1.properties,classpath:foo2.properties"/>
But then I am not able to access the right value:
<bean id="myDataSource" class="org.apache.commons.dbcp.BasicDataSource"
destroy-method="close">
<property name="driverClassName" value="${driver}" /> <!-- Which one? -->
<property name="url" value="${url}" /> <!-- Which one? -->
...
</bean>
How can I read my properties so that I can use variables such as ${foo1.driver}
and know which one is called?
Thanks for helping!
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…