spring 3.0中读取资源文件的方法如下:
假如有个配置文件为my_config_1.properties


prop1=Some property with some value
prop2=Some number here

<context:property-placeholder location="classpath:my_config_1.properties"/>

并且可以用注解
@Value("${prop1}")
private String myProperty;

这样myProperty的值就是prop1了;
但如果有两个配置文件呢?如:
my_config_2.properties 中:
second_file_prop=This comes from the second file

但:
<context:property-placeholder location="classpath:my_config_1.properties"/>
<context:property-placeholder location="classpath:my_config_2.properties"/>
的话,会发现出错:
因为会依然找第一个配置文件去找,所以必须加上属性,ignore-unresolvable
<context:property-placeholder location="classpath:my_config_1.properties" ignore-unresolvable="true"/>
<context:property-placeholder location="classpath:my_config_2.properties"/>

也可以加orders:
<context:property-placeholder location="classpath:my_config_1.properties" order="1" ignore-unresolvable="true"/>
<context:property-placeholder location="classpath:my_config_2.properties" order="2" ignore-unresolvable="true"/>

2.5中:
但是在Spring 2.5中,<context:property-placeholder>没有ignore-unresolvable属性,所以就不能使用上面的那种方法去配置,

可以改如下的格式:

<bean id="propertyConfigurer"

class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">

<property name="locations">

<list>

<value>classpath:/jdbc.properties</value>

</list>

</property>

</bean>