ApplicationContext ctx = null;
String[] configs={"classpath:bean/biz-datasource.xml","classpath:bean/biz-dao.xml","src/conf.test/bean/biz-ao.xml"};
ctx = new FileSystemXmlApplicationContext(configs);
主要是在配置文件中加上 classpath关键字,相对路径文件不需要加,适用于单元测试。
ApplicationContext ctx = null;
String[] configs={"classpath:bean/biz-datasource.xml","classpath:bean/biz-dao.xml","src/conf.test/bean/biz-ao.xml"};
ctx = new FileSystemXmlApplicationContext(configs);
主要是在配置文件中加上 classpath关键字,相对路径文件不需要加,适用于单元测试。