How do you configure a Spring bean container to load a Java property file?

前端 未结 6 1090
囚心锁ツ
囚心锁ツ 2021-02-02 01:48

How do you configure a Spring bean container (or application context) to load a Java property file?

JavaWorld article Smartly Load Your Properties explains how to load p

6条回答
  •  不要未来只要你来
    2021-02-02 02:42

    For example via the PropertiesFactoryBean. Use the PropertyPlaceholderConfigurer to configure beans in the context via properties.

    You will find PropertyPlaceholderConfigurer examples in the other answers. Here is a PropertiesFactoryBean example :

    
        
    
    

提交回复
热议问题