Spring加载多个配置文件的方式
1.第一种,使用数组
代码
ApplicationContext contex=new ClassXmlApplicationContext(new String["a1.xml","a2.xml"]);
2.第二种,只用通配符
代码
ApplicationContext contex=new ClassXmlApplicationContext("a*.xml");
//但此种方法只对文件系统中的xml文件有效,针对jar包中的无效
3.第三种,引入
代码
ApplicationContext contex=new ClassXmlApplicationContext("a1.xml");

//在a1.xml中
<import resource="a2.xml"/>//
执行resource路径为相对a1.xml的路径