标签:ica 就会 ring create public pos string ESS could
1,创建一个类,实现接口 BeanPostProcessor
package com.zuikc.web.controller;
import org.springframework.beans.BeansException;
import org.springframework.beans.factory.config.BeanPostProcessor;
public class GetBeansNames implements BeanPostProcessor {
public Object postProcessBeforeInitialization(Object bean, String beanName) throws BeansException {
return bean; // we could potentially return any object reference here...
}
//在创建bean后输出bean的信息
public Object postProcessAfterInitialization(Object bean, String beanName) throws BeansException {
System.out.println("Bean ‘" + beanName + "‘ created : " + bean.toString());
return bean;
}
}
2,在application.xml 中加入刚才创建的类名的bean
<bean class="com.zuikc.web.controller.GetBeansNames" />
3,在启动tomcat的时候就会打印创建beans的名称
标签:ica 就会 ring create public pos string ESS could
原文地址:https://www.cnblogs.com/albertzhangyu/p/9649080.html