对于ApplicationContext
ApplicationContext act=new ClassPathXmlApplicationContext(new String[] {"bean1.xml","bean2.xml"});
    
对于BeanFactory
BeanDefinitionRegistry reg = new DefaultListableBeanFactory();
XmlBeanDefinitionReader reader 
= new XmlBeanDefinitionReader(reg);
reader.loadBeanDefinitions(
new ClassPathResource("bean1.xml"));
reader.loadBeanDefinitions(
new ClassPathResource("bean2.xml"));
BeanFactory bf
=(BeanFactory)reg;