且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

将xml定义中的其他bean注册到已初始化的应用程序上下文中

更新时间:2023-10-11 23:00:28

如果我正确理解这一点,则希望将Bean从xml位置加载到已经存在的应用程序上下文中.你只是像这样afaik:

If I understand that correctly, you want to load beans from xml locations to an already existing application context. You just go like this afaik :

  ApplicationContext context;

  BeanDefinitionReader beanDefReader = new XmlBeanDefinitionReader(context) ;
  beanDefReader.loadBeanDefinitions(locations);
  context.refresh();