classpath 和 classpath* 区别:
classpath:只会到你指定的class路径中查找找文件;
classpath*:不仅包含class路径,还包括jar文件中(class路径)进行查找.


举个简单的例子,在我的web.xml中是这么定义的:classpath*:META-INF/spring-common.xml

那么在META-INF这个文件夹底下的所有spring-common.xml都会被加载到上下文中,

这些包括META-INF文件夹底下的 spring-common.xml

META-INF的子文件夹的spring-common.xml以及jar中的spring-common.xml



如果我在web.xml中定义的是:classpath:/spring/spring-env.xml
那么只有/spring底下的spring-env.xml会被加载到上下文中。

相关文章:

  • 2021-12-09
  • 2021-10-15
  • 2021-09-16
  • 2021-06-06
猜你喜欢
  • 2021-08-11
  • 2021-11-18
相关资源
相似解决方案