spring使用PropertiesFactoryBean读取properties文件

前端之家收集整理的这篇文章主要介绍了spring使用PropertiesFactoryBean读取properties文件前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
                                        <pre><code><!-- spring 配置-->

<bean id="systemProperties" class="org.springframework.beans.factory.config.Propertiesfactorybean">
<property name="locations">

classpath*:system.properties

注入到bean对象
@Component
public class ResourceBean {
private Properties systemProperties;

@autowired
public ResourceBean(Properties systemProperties){
    this.systemProperties = systemProperties;
}

}

猜你在找的程序笔记相关文章