spring读取配置文件

spring配置

<context:property-placeholder location="classpath:config.properties" ignore-resource-not-found="true" ignore-unresolvable="true"/>

config.properties

jdbc.password=111111

控制器读取

    @Value("${jdbc.password}")
    private String JDBCPassword;

 

posted @ 2016-03-10 13:26  ambitionless  阅读(122)  评论(0编辑  收藏  举报