zoukankan      html  css  js  c++  java
  • 在web.xml中classpath和classpath*的区别

    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会被加载到上下文中。
  • 相关阅读:
    CF1037H
    CF1296F
    CF1446F
    CF1175G
    CF1146G
    CF1303G
    CF1067D
    CF1477E
    COJ16G
    ZJOI2018 迷宫
  • 原文地址:https://www.cnblogs.com/love-omnus/p/4196566.html
Copyright © 2011-2022 走看看