To refer to attributes defined in the properties file in spring XML requires special loading, first using the Propertyplaceholderconfigurer
The typical configuration is as follows:
<bean id= "Common.propertyconfigurer"
class= "Org.springframework.beans.factory.config.PropertyPlaceholderConfigurer" >
<property name= "Ignoreresourcenotfound" value= "true"/>
<property name= "Ignoreunresolvableplaceholders" value= "true"/>
<property name= "fileencoding" value= "UTF-8"/>
<property name= "Locations" >
<list>
<value>classpath*:conf/default-*.properties</value>
<value>classpath*:conf/*.properties</value>
</list>
</property>
</bean>
This is the list assignment of the called locations, or it can be a single
<bean class= "Org.springframework.beans.factory.config.PropertyPlaceholderConfigurer" >
<property name= "Locations" value= "Classpath:com/foo/jdbc.properties"/>
</bean>
Properties in the configuration:
Jdbc.driverclassname=org.hsqldb.jdbcdriver
In the following section, you can use the
Value= "${jdbc.driverclassname}"
To access the properties value