classpath:就是WEB-INFO下存放编译好的class文件的目录,框架的配置文件一般也会放到这里;
classpath和classpath*的区别:举个简单的例子,在我的web.xml中是这么定义的:classpath*:META-INF/spring/application-context.xml,那么在META-INF/spring这个文件夹底下的所有application-context.xml都会被加载到上下文中,这些包括 META-INF/spring文件夹底下的 application-context.xml,META-INF/spring的子文件夹的application-context.xml以及 jar中的application-context.xml。
如果我在web.xml中定义的是:classpath:META-INF/spring/application-context.xml,那么只有META-INF/spring底下的application-context.xml会被加载到上下文中。
classpath和classpath*的区别:举个简单的例子,在我的web.xml中是这么定义的:classpath*:META-INF/spring/application-context.xml,那么在META-INF/spring这个文件夹底下的所有application-context.xml都会被加载到上下文中,这些包括 META-INF/spring文件夹底下的 application-context.xml,META-INF/spring的子文件夹的application-context.xml以及 jar中的application-context.xml。
如果我在web.xml中定义的是:classpath:META-INF/spring/application-context.xml,那么只有META-INF/spring底下的application-context.xml会被加载到上下文中。