web.xml中classpath*:与classpath:的区别
classpath对应src目录,该目录下的文件会在编译后被存放到WEB-INF文件夹下的classes目录。
classpath:只会到你的class路径中查找配置文件,对于多个同名的配置文件,只会加载找到的第一个文件;
classpath*:除了指定的class路径,还会到该class路径下的jar包中进行查找配置文件,对于多个同名的配置文件,都会被加载。
但是对于classpath*,无法使用模糊匹配的方式,可以通过逗号来隔开多个配置文件。
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>classpath*:applicationContext.xml,
classpath*:app-1.xml,
classpath*:app-2.xml,
classpath*:app-3.xml,
classpath*:app-4.xml
</param-value>
</context-param>
参考链接:
在Web.xml中自动扫描Spring的配置文件及resource时classpath*:与classpath:的区别
web.xml中classpath*:与classpath:的区别的更多相关文章
- web.xml 中<context-param>与<init-param>的区别与作用
<context-param>的作用: web.xml的配置中<context-param>配置作用 1. 启动一个WEB项目的时候,容器(如:Tomcat)会去读它的配置文件 ...
- web.xml中:<context-param>与<init-param>的区别与作用及获取方法
<context-param>的作用: web.xml的配置中<context-param>配置作用1. 启动一个WEB项目的时候,容器(如:Tomcat)会去读它的配置文件w ...
- web.xml中的ContextLoaderListener和DispatcherServlet区别
ContextLoaderListener和DispatcherServlet都会在Web容器启动的时候加载一下bean配置. 区别在于: DispatcherServlet一般会加载MVC相关的be ...
- 关于jsp web项目,jsp页面与servlet数据不同步的解决办法(报错404、405等)即访问.jsp和访问web.xml中注册的/servlet/的区别
报错信息: Type Status Report Message HTTP method GET is not supported by this URL Description The method ...
- 在web.xml中classpath和classpath*的区别
classpath 和 classpath* 区别: classpath:只会到你指定的class路径中查找找文件; classpath*:不仅包含class路径,还包括jar文件中(class路径) ...
- web.xml中classpath:和classpath*: 有什么区别?
web.xml中classpath:和classpath*: IccBoY applicationContext.xml 配置文件的存放位置 web.xml中classpath:和classp ...
- Web.xml中自动扫描Spring的配置文件及resource时classpath*:与classpath:的区别
Web.xml中自动扫描Spring的配置文件及resource时classpath*:与classpath:的区别 一.Web.xml中自动扫描Spring的配置文件(applicationCont ...
- Spring MVC-从零开始-web.xml中classpath和classpath* 有什么区别
web.xml中classpath和classpath* 有什么区别?classpath:只会到你的class路径中查找找文件;classpath*:不仅包含class路径,还包括jar文件中(cla ...
- web.xml中classpath 解释
经过我在对 web.xml 的配置测试: web.xml 中classpath 所指的路径是项目工程路径下的 classes 文件夹
随机推荐
- 拒绝干扰 解决Wi-Fi的最大问题
本文转载至:http://www.ciotimes.com/net/rdjs/WI-FI/201006301920.html 射频干扰英文:RFI,(Radio Frequency Interfere ...
- 死去活来的OC NSArray 中文排序 及输出
目的 1.NSArray 能够支持中文排序 2.NSLog 能够直接输出 NSArray 内的中文(事实上 java 直接打印数组也不能显示内容哈) 又是死去活来的搞了1个小时,分类实现.废话少说,上 ...
- 1987年国际C语言混乱代码大赛获奖的一行代码
macb() ? lpcbyu(&gbcq/_\021%ocq\012\0_=w(gbcq)/_dak._=}_ugb_[0q60)s+ 这是CoolShell博主之前做了一个非常有意思的在线 ...
- linux学习:进程间通信—管道
1.进程间通信当中一种比較简单的方法是管道操作 /* ========================================================================= ...
- Hibernate Jar包官方下载
1.新手入门,从官网下载Hibernate,选择 Hibernate ORM 2.选择Releases-Overview 3.上面列出的是最新版本,下面有一个see older series 直接下载 ...
- Pattern: Microservice Architecture
Microservice Architecture pattern http://microservices.io/patterns/microservices.html Context You ar ...
- compile java sources
Information:javac 1.8.0_91 was used to compile java sources D:\myjdk\bin\java "-javaagent:C:\Pr ...
- DOM操作一
1.通过ID选取元素 var section = document.getElementById("section1"); 2.通过ID查找多个元素 function getEle ...
- idea 设置背景图片
按下 Ctrl+Shift+A 你会看到一个对话框 在里面输入 Set Background Image 进入设置背景图片窗口 设置背景图,点击确定即可 就一个好看,强大的编程工具了
- Codeforces-707D:Persistent Bookcase (离线处理特殊的可持久化问题&&Bitset)
Recently in school Alina has learned what are the persistent data structures: they are data structur ...