general java
Spring 3] multiple properties in spring context file
'김용환'
2013. 11. 28. 19:11
Spring container의 context:property-placeholder 를 이용하여 여러개 이상의 properties 파일을 읽어오는 경우. 다음과 같이 사용하면 하나의 properties만 읽는 현상이 되어 문제가 발생한다.
<context:property-placeholder location="classpath:properties/jdbc.properties"/>
<context:property-placeholder location="classpath:properties/cassandra.properties"/>
다음과 같이 사용하면 된다.
<context:property-placeholder order="1" ignore-unresolvable="true" location="classpath:properties/jdbc.properties" />
<context:property-placeholder order="2" ignore-unresolvable="true" location="classpath:properties/cassandra.properties" />