web.xml 中 classpath 写法说明
简单理解,classpath就是代表 /WEB-INF /classes/ 这个路径(如果不理解该路径,就把一个web工程发布为war包,然后用winrar查看其包内路径就理解啦)
常用的场景:
在SSH架构中,配置Spring的上下文环境:
<!-- Spring Configures -->
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>
classpath:applicationContext.xml
</param-value>
</context-param>
里面的
classpath:applicationContext.xml
也可以使用 /WEB-INF /classes/ applicationContext.xml 代替
注意:
classpath 和 classpath* 区别:
classpath:只会到你的class路径中查找找文件;
classpath*:不仅包含class路径,还包括jar文件中(class路径)进行查找 ---- 够深入的吧
web.xml 中 classpath 写法说明的更多相关文章
- web.xml中classpath:和classpath*: 有什么区别?
web.xml中classpath:和classpath*: IccBoY applicationContext.xml 配置文件的存放位置 web.xml中classpath:和classp ...
- web.xml中classpath 解释
经过我在对 web.xml 的配置测试: web.xml 中classpath 所指的路径是项目工程路径下的 classes 文件夹
- Spring MVC-从零开始-web.xml中classpath和classpath* 有什么区别
web.xml中classpath和classpath* 有什么区别?classpath:只会到你的class路径中查找找文件;classpath*:不仅包含class路径,还包括jar文件中(cla ...
- 在web.xml中classpath和classpath*的区别
classpath 和 classpath* 区别: classpath:只会到你指定的class路径中查找找文件; classpath*:不仅包含class路径,还包括jar文件中(class路径) ...
- web.xml中classpath*:与classpath:的区别
classpath对应src目录,该目录下的文件会在编译后被存放到WEB-INF文件夹下的classes目录. classpath:只会到你的class路径中查找配置文件,对于多个同名的配置文件,只会 ...
- web.xml中classpath表示什么样的路径
首先 classpath是指 WEB-INF文件夹下的classes目录 解释classes含义: 1.存放各种资源配置文件 eg.init.properties log4j.properties ...
- Web.xml中自动扫描Spring的配置文件及resource时classpath*:与classpath:的区别
Web.xml中自动扫描Spring的配置文件及resource时classpath*:与classpath:的区别 一.Web.xml中自动扫描Spring的配置文件(applicationCont ...
- web.xml中的url-pattern写法规则及匹配过程
servlet和filter在javaEE开发中很常用,因此有必要知道web.xml文件映射的规则 1. 写法 ①完全匹配:以“/”开头,以字母(非“*”)结束 如:<url-patte ...
- web.xml中的classpath是啥
在web.xml中一个很面熟的字:classpath,它到底是个啥? <servlet> <servlet-name>dispatcherServlet</servlet ...
随机推荐
- linux cut 命令
cut:以某种方式按照文件的行进行分割 参数列表: -b 按字节选取 忽略多字节字符边界,除非也指定了 -n 标志 -c 按字符选取 -d 自定义分隔符,默认为制表符. -f 与-d一起使用,指定显示 ...
- Android开发之定位系统
2013-07-04 定位系统 全球定位系统(Global Positioning System, GPS), 又称全球卫星定位系统. 最少只需其中3颗卫星,就能迅速确定用户组地球所处的位置及海拔高度 ...
- Python装饰器(Decorator)简介
Python有许多出色的语言特性,装饰器(Decorator)便是其中一朵奇葩.先来看看一段代码: def deco1(f): print 'decorate 1' return f def deco ...
- jQuery MiniUI自定义单元格
监听处理"drawcell"事件 使用"drawcell"事件,可以自定义单元格内容.样式.行样式等. grid.on("drawcell" ...
- sso单点登录研究
iframe跨域通信的通用解决方案http://www.alloyteam.com/2012/08/lightweight-solution-for-an-iframe-cross-domain-co ...
- MySQL防止delete命令删除数据
在sql中删除数据库中记录我们会使用到delete命令,这样如果不小心给删除了很难恢复了,总结一些删除数据但是不在数据库删除的方法. 方法一 我常用的做法,就是在数据库中加一个删除标识字段,如: is ...
- Getting Started with Amazon EC2 (1 year free AWS VPS web hosting)
from: http://blog.coolaj86.com/articles/getting-started-with-amazon-ec2-1-year-free-aws-vps-web-host ...
- JS四种方法去除字符串最后的逗号
<script> window.onload=function() { var obj = {name: "xxx", age: 30, sex: "fema ...
- doc转docx以及type对应的类型
https://blog.csdn.net/flagang/article/details/51454665 // 作为type格式保存到临时文件 // *Variant(0):doc // *Var ...
- Error C2280
原因:默认参数用的assignment,而不是reference,要知道ostream并没有实现copy constructor/assignment operator(通过bing.com搜索Err ...