ITeye博客

PropertyPlaceholderConfigurer

wangyun · 2008-06-23 10:11 · Spring · Spring · Bean · Markdown

BeanFactoryPostProcessor 接口是对Bean 工厂的后处理操作。 在Spring 的PropertyPlaceholderConfigurer 类是实现BeanFactoryProcessor 接口中非常有用的类。它用于Spring 从外部属性文件中载入属性,并使用这些属性值替换Spring 配置文件中的占位符变量(${varible})。 Spring 的ApplicationContext 容器可以非常方便的使用PropertyPlaceholderConfigurer,只需通过简单的配置即可使用。 示例: 如果需要使用多个配置文件可以使用PropertyPlaceholderConfigurer 的locations属性。

评论(0)

暂无评论。

评论功能维护中,当前仅展示历史评论。