Spring的后置处理器BeanFactoryPostProcessor

新建一个JavaBean



UserBeanFactoryPostProcessor 实现了BeanFactoryPostProcessor接口



Spring配置文件如下:



编写测试用例


从结果可以看出因为BeanFactoryPostProcessor 中输出的username已经变成了quanyongan,而不是test.说明BeanFactoryPostProcessor确实有能力改变初始化BEAN的内容 

原文地址:https://www.cnblogs.com/quanyongan/p/4133725.html