---
title: "PropertyPlaceholderConfigurer"
author: "wangyun"
date: "2008-06-23T10:11:32Z"
tags: ["Bean", "Spring"]
slug: "propertyplaceholderconfigurer"
draft: false
lastmod: "2008-06-23T10:11:32Z"
id: 207004
url: "https://wangyun.iteye.com/blog/207004"
---

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