在web.xml中classpath和classpath*的区别
来源:互联网 发布:js保存json到本地 编辑:程序博客网 时间:2024/06/05 05:32
转自:http://blog.sina.com.cn/s/blog_76786df301016al4.html
写spring的代码到现在,一直都很习惯性的拷贝web.xml中的内容,没怎么在意里面的内容,最近认真研究了下,很多东西都不是很理解,特别是classpath和classpath*的区别,研究了许久才搞明白,记录下备忘。
classpath 和 classpath* 区别:
classpath:只会到你指定的class路径中查找找文件;
classpath*:不仅包含class路径,还包括jar文件中(class路径)进行查找.
举个简单的例子,在我的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会被加载到上下文中。
0 0
- 在web.xml中classpath和classpath*的区别
- 在web.xml中classpath和classpath*的区别
- 在web.xml中classpath和classpath*的区别
- 在web.xml中classpath和classpath*的区别
- 在web.xml中classpath和classpath*的区别
- 在web.xml中classpath和classpath*的区别
- 在web.xml中classpath和classpath*的区别
- 在web.xml中classpath和classpath*的区别
- web.xml中classpath:和classpath*:的区别
- web.xml中classpath和classpath*的区别
- web.xml中classpath和classpath*的区别
- web.xml中classpath和classpath*的区别
- web.xml中classpath和classpath*的区别
- 在web.xml中classpath和classpath*的区别。/与/*的区别
- javaweb项目中web.xml配置classpath 和 classpath* 区别
- web.xml中classpath:和classpath*: 有什么区别
- web.xml 配置中classpath: 与classpath*:的区别
- web.xml 中 classpath*:与classpath:的区别
- My SQL 删除数据表
- Linux第二课
- Linux常用命令-------文件
- Oracle 常用函数
- Linux常用命令-------系统用户权限
- 在web.xml中classpath和classpath*的区别
- BSOJ2923 CODEVS1419 藤原妹红 最小生成树+树形dp
- 遇见,控件----AutoCompleteTextView
- RCNN学习笔记(11):R-FCN: Object Detection via Region-based Fully Convolutional Networks
- LeetCode 169. Majority Element 解题报告
- Oracle数据库(数据字典、表空间、表的创建、视图)
- Linux常用命令-------网络
- android布局属性大全
- Linux下的压缩解压缩命令详解