1、info.properties
brand=root
born=123456
speed=123
2、beans-properties.xml
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:context="http://www.springframework.org/schema/context"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-4.1.xsd">
<!-- 导入配置属性文件 -->
<context:property-placeholder location="classpath:db.properties"/>
<bean id="car" class="com.kelen.beans.properties.Car">
<property name="brand" value="${brand}"></property>
<property name="born" value="${born}"></property>
<property name="speed" value="${speed}"></property>
</bean>
</beans>