本机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. Win7 JavaEE 安装

    新建四个目录 D:\ApacheServer\eclipse 存放eclipse D:\ApacheServer\jdk jdk安装目录 D:\ApacheServer\apache-tomcat 存 ...

  2. Redis部分

  3. Python--jsonpath

    JsonPath是一种信息抽取类库,是从JSON文档中抽取指定信息的工具,提供多种原因实现保本:JavaScript/Python/PHP和Java. 使用方法如: import jsonpathre ...

  4. 解决GitHub下载速度缓慢的问题

    随着微软大大宣布GitHub针对个人用户的仓库免费,相信每位开发者都感受到了"真香". 然而因为一些众所周知的原因,国内访问GitHub总会遇到下载速度缓慢.链接意外终止的情况. ...

  5. 原生js上传图片遇到的坑(axios封装)

    后台给我写了一个上传图片的接口,自己用form表单测试成功 接口可以正常跳转 测试的代码: <!doctype html> <html lang="en"> ...

  6. vue的自定义指令

    点击元素之外触发函数 <template> <div v-clickoutside="clickItemOut"></div> </tem ...

  7. 1 使用webpack搭建vue开发环境

    1 先去node.js官网下载nodejs并且安装 安装成功之后在命令行输入node -v 回车,npm -v回车如果显示对应的版本号,说明node安装成功,自带的npm也安装成功 2 在d盘下创建一 ...

  8. 配置Hadoop,hive,spark,hbase ————待整理

    五一一天在家搭建好了集群,要上班了来不及整理,待下周周末有时间好好整理整理一个完整的搭建hadoop生态圈的集群的系列 若出现license information(license not accep ...

  9. kNN(K-Nearest Neighbor)最邻近规则分类(转)

    KNN最邻近规则,主要应用领域是对未知事物的识别,即判断未知事物属于哪一类,判断思想是,基于欧几里得定理,判断未知事物的特征和哪一类已知事物的的特征最接近: K最近邻(k-Nearest Neighb ...

  10. springboot系列(四)springboot 配置

    在springboot出现之前,spring项目会存在多个配置文件,如web.xml,配置spring的多个spring-xxx.xml,xxx代表配置spring的某一功能,如aplication- ...