1.classpath
单独写classpath:applicationContext.xml,表示只会加入第一个查找到的applicationContext.xml,就算有多个也只会加入一个
2.classpath*
classpath*:applicationContext.xml,表示本项目和所有依赖的jar包根目录下的applicationContext.xml,跨包依赖时使用
本文详细解释了在Spring配置文件中使用classpath与classpath*的区别。classpath仅加载第一个找到的applicationContext.xml文件,而classpath*则会加载项目及其依赖的所有匹配的applicationContext.xml文件。
1.classpath
单独写classpath:applicationContext.xml,表示只会加入第一个查找到的applicationContext.xml,就算有多个也只会加入一个
2.classpath*
classpath*:applicationContext.xml,表示本项目和所有依赖的jar包根目录下的applicationContext.xml,跨包依赖时使用

被折叠的 条评论
为什么被折叠?