ClassPathXmlApplicationContext加载多个配置文件
一共有两种方法:
第一种:数组方式
String[] configLocations = new String[]{“spring/applicationContext-dao.xml”,“spring/applicationContext-service.xml”,“spring/applicationContext-trans.xml”};
ApplicationContext ac = new ClassPathXmlApplicationContext(configLocations);
第二种:* 匹配
ApplicationContext ac = new ClassPathXmlApplicationContext(“classpath:applicationContext-*.xml”);