1. Spring使用ClassPathXmlApplicationContext 从classpath读取ClassPathXmlApplicationContext 默认会去 classPath 路径下找。classPath 路径指的就是编译后的 classes 目录。 1.1 如果配置文件在classpath目录下:ClassPathXmlApplicationContext tx = new ClassPathXmlApplicationContext("appContext2.xml"); 1.2 如果一个包专门用来存配置文件ClassPathXmlApplicationContext tx = new ClassPathXmlApplicationContext("//my/config/appContext2.xml");或者ClassPathXmlApplicati
Spring学习总结(24)——Spring配置文件加载路径总结
关注
打赏