spring导入属性文件

spring2.5之后导入属性文件的方法

在XML中加入

<context:property-placeholder location="classpath:db.properties"/>
<bean id="" class="">
    <property name="user" value="${user}"><property/>
</bean>



db.properties

user=root
View Code

 

posted on 2015-05-27 21:15  kevin~kai  阅读(143)  评论(0)    收藏  举报