spring_spring容器以外类获取spring容器内部Bean

 applicationContext = new ClassPathXmlApplicationContext(new String[]{"applicationContext.xml"});
 XBean xBean = (XBean)applicationContext.getBean("xBean");

你可能感兴趣的:(spring)