怎样查看spring容器有哪些bean

 

 

public static void main(String args[]) {
  ApplicationContext context=new ClassPathXmlApplicationContext("classpath:spring-applicationContext.xml");
  Object user= context.getBean("userController");
  String[] str=context.getBeanDefinitionNames();
  for (String string : str) {
    System.out.println("..."+string);
  }
  System.out.println("----"+user);

}
// REF https://blog.csdn.net/chengjunhua19890809/article/details/77981839

 

 

REF

https://blog.csdn.net/loongshawn/article/details/106259754

https://blog.csdn.net/const_/article/details/100039428

 

上一篇:Java核心技术——第一章:基本程序设计结构


下一篇:Blog项目笔记-终极版本