It is NOT recommended to place <Context> elements directly in the server.xml file. This is because it makes modifying the Context configuration more invasive since the main conf/server.xml file cannot be reloaded without restarting Tomcat.

不建议放在server.xml中增加节点,需要重启

Individual Context elements may be explicitly defined:

  • In an individual file at /META-INF/context.xml inside the application files. In Tomcat 6 this file is automatically copied to $CATALINA_BASE/conf/[enginename]/[hostname]/ and renamed to application's base file name plus a ".xml" extension. (This automated copying became optional in Tomcat 7).
  • META-INF / context.xml里面被共享
  • In individual files (with a ".xml" extension) in the $CATALINA_BASE/conf/[enginename]/[hostname]/ directory. The context path will be derived from the base name of the file (the file name less the .xml extension). This file will always take precedence over any context.xml file packaged in the web application's META-INF directory.
  • 映射成xml文件出去前缀的地址,ROOT.xml,缺省,需要重启
  • Inside a Host element in the main conf/server.xml.

Default Context elements may be defined that apply to multiple web applications. Configuration for an individual web application will override anything configured in one of these defaults. Any nested elements, e.g. <Resource> elements, that are defined in a default Context will be created once for each Context to which the default applies. They will not be shared between Context elements.

  • In the $CATALINA_BASE/conf/context.xml file: the Context element information will be loaded by all web applications.
  • In the $CATALINA_BASE/conf/[enginename]/[hostname]/context.xml.default file: the Context element information will be loaded by all web applications of that host.

With the exception of server.xml, files that define Context elements may only define a single Context element.

In addition to explicitly specified Context elements, there are several techniques by which Context elements can be created automatically for you. See Automatic Application Deployment and User Web Applications for more information.

To define multiple contexts that use a single WAR file or directory, use one of the options described in the Naming section above for creating a Context that has a path that is not related to the base file name.

转载于:https://www.cnblogs.com/lhsu2014/p/4915549.html

Web应用虚拟目录的映射的几种方式相关推荐

  1. Java框架JSON-RPC项目demo代码实战 + JAVA WEB配置虚拟目录(转自21天java web开发)

    Java框架JSON-RPC项目demo代码实战 备注  JAVA WEB配置虚拟目录(转自21天java web开发) https://blog.csdn.net/wjxbj/article/det ...

  2. web服务器虚拟目录_调整专用虚拟Web服务器

    web服务器虚拟目录 When you get a dedicated virtual server to run your website, chances are good that it's c ...

  3. java web 启动时执行_java Web 启动时自动执行代码的几种方式

    Web容器启动后执行代码的几种方式,其执行顺序为:4===>5===>1===>2===>3,即指定init-method的Bean开始执行,接着实现spring的Bean后置 ...

  4. 实现内网映射的三种方式:

    实现内网映射的三种方式: 1.ngrok. 1)下载ngrok  下载地址:https://ngrok.com/download  选择合适的版本下载,我下载的是win64为的是这样: 2)解压下载下 ...

  5. c#web服务器 虚拟目录,C#建立自己的Web服务器

    C#建立自己的Web服务器 个人珍藏,仅为存档.今天整理磁盘,没处放.扔BLOG. 看不懂,别问我.自己研究. webserver.cs namespace cnnbsun.webserver { u ...

  6. MyBatis-20MyBatis高级结果映射【一对一映射(4种方式)】

    文章目录 概述 需求 方式一:使用自动映射处理一对一映射 实体类改造 UserMapper接口增加接口方法 UserMapper.xml增加SQL 单元测试 方式二:使用resultMap配置一对一映 ...

  7. Code First02---CodeFirst配置实体与数据库映射的两种方式

    Code First有两种配置数据库映射的方式,一种是使用数据属性DataAnnotation,另一种是Fluent API. 这两种方式分别是什么呢?下面进行一一解释: DataAnnotation ...

  8. ASP.NET Web API接受AngualrJS的QueryString的两种方式

    ASP.NET Web API如何接受来自AngualrJS的QueryString呢?本篇体验两种方式. 第一种方式:http://localhost:49705/api/products?sear ...

  9. 【Web技术】1091- 跨浏览器窗口 ,7种方式,你还知道几种呢?

    前言 为什么会扯到这个话题,最初是源于听 https://y.qq.com/ QQ音乐, 播放器处于单独的一个页面 当你在另外的一个页面搜索到你满意的歌曲的时候,点击播放或添加到播放队列 你会发现,播 ...

最新文章

  1. MYSQL注入天书之服务器(两层)架构
  2. 《Unity开发实战》——3.9节鼠标悬停时高亮显示材质
  3. CISCO网络故障排错命令总结分享
  4. centos7安装MongoDB(亲测)
  5. 【AI视野·今日Robot 机器人论文速览 第六期】Fri, 11 Jun 2021
  6. linux常用命令实战
  7. python在线朗读-简单的python代码实现语音朗读
  8. java学生管理系统登录注册_《Java》— 学生管理系统——登录界面
  9. SQLite attach detach 心得
  10. Windows下C++调用系统软键盘及其需要注意的点
  11. Mysql之to_base64编码from_base64解密和AES_ENCRYPT加密AES_DECRYPT解密
  12. java awt生成签名图片消除锯齿化
  13. 九款免费轻量的 AutoCAD 的开源替代品推荐
  14. OpenNI Grabber Framework in PCL代码更新(适用于pcl_12.0)
  15. Qt4 到Qt5 最小化后 点击任务栏不显示问题
  16. CLOB、BLOB , CLOB与BLOB的区别
  17. 【ML】第六章 决策树
  18. python 生成exe 图片资源_爱豆图片下载(含源码及打包exe可执行文件)
  19. 三国群英传服务器未响应,《三国群英传2》近期服务器不稳定问题说明
  20. 安科瑞Acrel-BUS智能照明控制系统在医院的应用

热门文章

  1. 网站优化中哪些设置会影响蜘蛛的抓取?对网站SEO产生什么影响?
  2. 如何应对一直变化的搜索引擎算法?
  3. dba用什么工具连接mysql_DBA必备的15款MySQL管理工具
  4. 分布式服务框架原理与实践pdf_深度解析微服务治理的技术演进和架构实践
  5. mysql curd操作_(四):CURD操作详解(增删改查)
  6. mac mysql 5.7.9安装教程_mac系统OS X10.10版本安装最新5.7.9mysql的方法_MySQL
  7. 融云发送自定义消息_数据源管理 | Kafka集群环境搭建,消息存储机制详解
  8. 开发日记-20190710 关键词 读书笔记 《Perl语言入门》Day 7
  9. AngularJS2.0 quick start——其和typescript结合需要额外依赖
  10. Golang开发环境搭建-Vim篇