在web.xml中一个很面熟的字:classpath,它到底是个啥?


<servlet>
<servlet-name>dispatcherServlet</servlet-name>
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
<init-param>
<param-name>encoding</param-name>
<param-value>UTF-8</param-value>
</init-param>
<init-param>
<param-name>contextConfigLocation</param-name>
<param-value>classpath:resource/spring-mvc.xml</param-value>
</init-param>
<load-on-startup>2</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>dispatcherServlet</servlet-name>
<url-pattern>/</url-pattern>
</servlet-mapping>

首先

classpath是指 WEB-INF文件夹下的classes目录

其次据说

classpath:只会到你指定的class路径中查找文件;

classpath*:不仅包含class路径,还包括jar文件中(class路径)进行查找.


声明:内容个人整理所得,本人不为以上言论付任何责任,因为我自己看啊

web.xml中的classpath是啥的更多相关文章

  1. web.xml中配置classpath:和classpath*:的区别和意思

    首先 classpath是指 WEB-INF文件夹下的classes目录 解释classes含义: 1.存放各种资源配置文件 eg.init.properties log4j.properties s ...

  2. 在web.xml中classpath和classpath*的区别

    classpath 和 classpath* 区别: classpath:只会到你指定的class路径中查找找文件; classpath*:不仅包含class路径,还包括jar文件中(class路径) ...

  3. web.xml中classpath:和classpath*: 有什么区别?

    web.xml中classpath:和classpath*:     IccBoY applicationContext.xml 配置文件的存放位置 web.xml中classpath:和classp ...

  4. Web.xml中自动扫描Spring的配置文件及resource时classpath*:与classpath:的区别

    Web.xml中自动扫描Spring的配置文件及resource时classpath*:与classpath:的区别 一.Web.xml中自动扫描Spring的配置文件(applicationCont ...

  5. web.xml中classpath 解释

    经过我在对 web.xml 的配置测试: web.xml 中classpath 所指的路径是项目工程路径下的 classes 文件夹

  6. web.xml中classpath*:与classpath:的区别

    classpath对应src目录,该目录下的文件会在编译后被存放到WEB-INF文件夹下的classes目录. classpath:只会到你的class路径中查找配置文件,对于多个同名的配置文件,只会 ...

  7. Spring MVC-从零开始-web.xml中classpath和classpath* 有什么区别

    web.xml中classpath和classpath* 有什么区别?classpath:只会到你的class路径中查找找文件;classpath*:不仅包含class路径,还包括jar文件中(cla ...

  8. web.xml中的contextConfigLocation在spring中的作用

    在web.xml中通过contextConfigLocation配置spring, contextConfigLocation参数定义了要装入的 Spring 配置文件.默认会去/WEB-INF/下加 ...

  9. JavaEE web.xml 中ContextLoaderListener的解析

    ContextLoaderListener监听器的作用就是启动Web容器时,自动装配ApplicationContext的配置信息.因为它实现了ServletContextListener这个接口,在 ...

随机推荐

  1. 初识Python和使用Python爬虫

     一.python基础知识了解:   1.特点: Python的语言特性: Python是一门具有强类型(即变量类型是强制要求的).动态性.隐式类型(不需要做变量声明).大小写敏感(var和VAR代表 ...

  2. java打包成可执行的jar或者exe的详细步骤

    Java程序完成以后,对于Windows操作系统,习惯总是想双击某个exe文件就可以直接运行程序,现我将一步一步的实现该过程.最终结果是:不用安装JRE环境,不用安装数据库,直接双击一个exe文件,就 ...

  3. Codeforces 1249E By Elevator or Stairs? 题解

    这题其实和 NIKKEI 2019-2-D Shortest Path on a Line 差不多的啦,都是一种最短路的变形,把多个点和边关联了起来. 题面 你要从一楼到 \(n\) 楼去,每层楼可以 ...

  4. JavaScript 中 new 关键字结合构造函数创建对象

    步骤: new会在内存中创建一个新的空对象 new 会让this指向这个新的对象 执行构造函数(给这个新对象添加属性和方法) new会返回这个新对象

  5. 【Android】在程序中使用触力反馈

    触力反馈又名:hapticFeedbackEnabled 一般有两种实现方式 第一种是在XML布局文件里面设置 android:hapticFeedbackEnabled="true&quo ...

  6. 「NOIP2016」愤怒的小鸟

    传送门 Luogu 解题思路 首先这个数据范围十分之小啊. 我们考虑预处理出所有可以带来贡献的抛物线 三点确定一条抛物线都会噻 然后把每条抛物线可以覆盖的点状压起来,然后状压DP随便转移就好了. 有一 ...

  7. 082、Java数组之数组传递之简化理解

    01.代码如下: package TIANPAN; /** * 此处为文档注释 * * @author 田攀 微信382477247 */ public class TestDemo { public ...

  8. python中判断素数的函数

    来看这一种判断素数(质数)的函数: form math import sart def is_prime(n): if n==1: return False for i in range(2, int ...

  9. 开发工具类(eclipse、安卓SDK) 镜像站

    1.eclipse 中国科技大学:http://mirrors.ustc.edu.cn/eclipse/ 中国科学院:http://mirrors.opencas.cn/eclipse/ 东北大学:h ...

  10. Ubuntu系统部署tomcat并启用JMX实战案例

    Ubuntu系统部署tomcat并启用JMX实战案例 作者:尹正杰 版权声明:原创作品,谢绝转载!否则将追究法律责任. 一.安装JDK环境 1>.更换阿里云的软件源 [root@zabbix_g ...