且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

Spring 类路径前缀区别

更新时间:2023-01-11 11:15:26

简单定义

classpath*:conf/appContext.xml 只是意味着 conf 文件夹下的 所有 appContext.xml 文件类路径将被选取并加入到一个大的应用程序上下文中.

The classpath*:conf/appContext.xml simply means that all appContext.xml files under conf folders in all your jars on the classpath will be picked up and joined into one big application context.

相比之下,classpath:conf/appContext.xml只加载一个这样的文件...在您的类路径中找到的第一个.

In contrast, classpath:conf/appContext.xml will load only one such file... the first one found on your classpath.