本机tomcat位置:D:\tomcat7\apache-tomcat-7.0.61


context.xml

位置:D:\tomcat7\apache-tomcat-7.0.61\conf

每个Web应用程序将加载此文件的内容。

tomcat服务器会定时去扫描这个文件。一旦发现文件被修改(时间戳改变了),就会自动重新加载这个文件,而不需要重启服务器。

<?xml version='1.0' encoding='utf-8'?>
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<!-- The contents of this file will be loaded for each web application -->
<Context> <!-- Default set of monitored resources -->
<WatchedResource>WEB-INF/web.xml</WatchedResource> <!-- Uncomment this to disable session persistence across Tomcat restarts -->
<!--
<Manager pathname="" />
--> <!-- Uncomment this to enable Comet connection tacking (provides events
on session expiration as well as webapp lifecycle) -->
<!--
<Valve className="org.apache.catalina.valves.CometConnectionManagerValve" />
--> </Context>

<WatchedResource>:指定被监视的资源,此元素可定义多个。如果WEB-INF/web.xml内容改变了,则自动重新加载改应用。


context.xml的三个作用范围

1. tomcat server级别:

在/conf/context.xml里配置

2. Host级别:

在/conf/Catalina/${hostName}里添加context.xml,继而进行配置

3. web app 级别:

在/conf/Catalina/${hostName}里添加${webAppName}.xml,继而进行配置


参考文档:

Tomcat中context.xml的配置

Tomcat的context.xml说明、Context标签讲解

tomcat——context.xml的更多相关文章

  1. embedded tomcat context.xml

    在网络下载相关的embedded tomcat jar.也可直接在maven中检索. 在main方法中,输入以下代码: //新建tomcat实例 Tomcat tomcat = new Tomcat( ...

  2. Tomcat 部署:工程下 META-INF 目录下的 Context.xml

    tomcat 在META-INF 文件夹中添加context.xml,使项目自动应用更新文件 Meta-inf文件夹下新建context.xml. <Context path="/FU ...

  3. Tomcat 的context.xml

    1. 在tomcat 5.5之前: --------------------------------------------------------------- Context体如今/conf/se ...

  4. Tomcat中的Context.xml的<Loader delegate="true"/>

    Tomcat中的Context.xml的<Loader delegate="true"/> 1.<Loader delegate="true" ...

  5. Tomcat下使用C3P0配置JNDI数据源(在项目的META-INF目录下创建context.xml的文件)

    一.C3P0下载 C3P0下载地址:http://sourceforge.net/projects/c3p0/files/?source=navbar 下载完成之后得到一个压缩包

  6. tomcat配置文件context.xml和server.xml分析

    在tomcat 5.5之前Context体现在/conf/server.xml中的Host里的<Context>元素,它由Context接口定义.每个<Context元素代表了运行在 ...

  7. 在tomcat下context.xml中配置各种数据库连接池(JNDI)

    1.   首先,需要为数据源配置一个JNDI资源.我们的数据源JNDI资源应该定义在context元素中.在tomcat6版本中,context元素已经从server.xml文件中独立出来了,放在一个 ...

  8. Tomcat 的context.xml说明、Context标签讲解

    Tomcat的context.xml说明.Context标签讲解 1. 在tomcat 5.5之前 --------------------------- Context体现在/conf/server ...

  9. Tomcat的context.xml说明、Context标签讲解

    Tomcat的context.xml说明.Context标签讲解 1. 在tomcat 5.5之前 --------------------------- Context体现在/conf/server ...

随机推荐

  1. 在Ubuntu中安装了MongoDB后无法启动mongod的问题

    今天准备学习MongoDB,没想到下载之后服务器端启动不了,记录一下问题和处理过程 一.安装 在Ubuntu中安装还是很简单,直接:sudo apt install mongodb 二.启动 启动Mo ...

  2. MongoDB 聚合函数及排序

    聚合函数 最大值  $max db.mycol.aggregate([{$group : {_id : "$by_user", num_max : {$max: "$li ...

  3. pandas之数据IO笔记

    pandas在进行数据存储与输出时会做一些相应的操作 1.*索引:将一个列或多个列读取出来构成DataFrame,其中涉及是否从文件中读取索引以及列名 2 *类型推断和数据转换:包括用户自定义的转换以 ...

  4. c++学习---迭代器

    迭代器类型: begin和end的返回值的类型由对象是否为常量所决定 无论对象是都为常量,cbegin和cend都将都到一个const_iterator

  5. SpringCloud Hystrix/Feign 整合 Hystrix 后首次请求失败解决方案

  6. CSS3中三种清除浮动(float)影响的方式

    float是HTML中布局的一大关键,很多难题一旦用上float都能很愉快地解决.但是凡是好用的,也容易出错.比如当子元素都为float时,其父元素会受影响,或者偶尔会发现自己某个div的高度变成了0 ...

  7. (二)Spring框架之JDBC的基本使用(p6spy插件的使用)

    案例一: 用Spring IOC方式使用JDBC Test_2.java package jdbc; import java.lang.Thread.State; import java.sql.Co ...

  8. android 和 js 交互

    1.html代码 <script type="text/javascript"> function javacalljs(){ document.getElementB ...

  9. [NOIP2018模拟赛10.18]自闭报告

    闲扯 这一天,菜鸡RyeCatcher又想起来了被毒瘤题支配的恐惧 今天比较好玩,还是ljy提醒才发现文件夹里有题面...不知道外面的人什么时候才发现 看完了题面,又回到了雅礼啥题也不会写的感觉 T1 ...

  10. wangeditor富编辑器在node和vue前后台分离的使用

    本来是想用百度的ueditor编辑器来达到想要的功能的,但在使用中,感觉前后台分离上,需要引入的东西过多,不轻量:然后就去尝试用wangeditor(这个名字听着感觉有点太随意的感觉....但功能上还 ...