If you assign a default value to a variable in Application.xml, and you assign a value to a variable in properties.xml, the problem is that the value in Properties.xml is not taken after it is loaded.
To solve this problem, you need to add a bold partial configuration:
<bean id= "sysconfiguration" class= "Org.springframework.beans.factory.config.PropertyPlaceholderConfigurer" >
<property name= "Order" value= "1"/>
<property name= "Ignoreunresolvableplaceholders" value= "true"/>
<property name= "Locations" >
<list>
<value>classpath:service.properties</value>
</list>
</property>
<property name= "fileencoding" value= "Utf-8"/>
</bean>
To illustrate:
Service.properties file
# # #变量定义 # #
Service.period = 10
Service.delay=50
Applicaton.xml configuration file
<bean id= "test" class= "Cn.com.Test" >
<property name= "period" value= "${service.period:5}"/>
<property name= "delay" value= "${service.delay:2}"/>
</bean>
Defining variables in Properties.xml, taking value problems in Application.xml