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 文件夹
随机推荐
- iOS之UI--使用SWRevealViewController 实现侧边菜单功能详解实例
iOS之UI--使用SWRevealViewController 实现侧边菜单功能详解实例 使用SWRevealViewController实现侧边菜单功能详解 下面通过两种方法详解SWReveal ...
- Jenkins+appium+testng持续集成
Create maven project in eclipseAdd Appium , Selenium dependancyAdd Test in TestNG testCreate TestNG ...
- Robotium结果的收集和失败重跑
引用自 http://www.robotium.cn/archives/author/zered 测试用例: testsuite管理测试用例 测试结果的输出与收集? InstrumentationTe ...
- 十天学习PHP之第二天
学习目的:学会构建数据库 在ASP中,假设是ACCESS数据库你能够直接打开ACCESS来编辑MDB文件,假设是SQL SERVER你能够打开企业管理器来编辑SQL SERVER数据库.可是在PHP ...
- SpringBoot项目 部署到服务器的tomcat下
把spring-boot项目按照平常的web项目一样发布到tomcat容器下 一.修改pom文件 修改打包方式 修改或增加maven插件 注意: 二.移除嵌入式tomcat插件 三.添加servlet ...
- CentOS 6.5 通过 PHP函数的sendmail 发送邮件
非常多站点须要用到Sendmail函数发送激活邮件,在centos中内置了Sendmail模块,直接调用就可以,假设遇到问题,可採用例如以下两个步骤检測并解决: 1. 命令行输入:echo " ...
- 从零开始徒手撸一个vue的toast弹窗组件
相信普通的vue组件大家都会写,定义 -> 引入 -> 注册 -> 使用,行云流水,一气呵成,但是如果我们今天是要自定义一个弹窗组件呢? 首先,我们来分析一下弹窗组件的特性(需求): ...
- MongoDB C++ gridfs worked example
使用libmongoc,参考:http://mongoc.org/libmongoc/current/mongoc_gridfs_t.html #include <mongoc.h> #i ...
- 时间:NSTimer,代码时运行时间段,
一:NSTimer 当时间间隔>1s是用NSTimer; 方法: [NSTimer scheduledTimerWithTimeInterval:0.01 target:self selecto ...
- Identifier expected after this token
Cursor cursor = db.query(true, "user", new String[]{"id","mode"}, &quo ...