来源官方文档 html
1. The Context element represents a web application web
context 表明着一个应用
apache
2. 能够并行部署 tomcat
You may deploy multiple versions of a web application with the same context path at the same time
session
3. 定义一个context app
It is NOT recommended to place <Context> elements directly in the server.xml file. This is because it makes modifying theContext configuration more invasive since the main conf/server.xml file cannot be reloaded without restarting Tomcat. ide
不推荐直接在server.xml中定义context, (就是<host>内部那个) this
context 文件位置 spa
- /META-INF/context.xml inside the application files
- $CATALINA_BASE/conf/[enginename]/[hostname]/ 目录下 已.xml 结尾文件 如默认的 /catalina/localhost
- 就是在server.xml 中的 engine/host/context
4. $CATALINA_BASE/conf/context.xml 文件是全局共享的, 能够定义一些全局资源 rest
5. cotext 属性
http://tomcat.apache.org/tomcat-7.0-doc/config/context.html#Common_Attributes
6. context 内嵌元素
- Loader - Configure the web application class loader that will be used to load servlet and bean classes for this web application. Normally, the default configuration of the class loader will be sufficient.
- Manager - Configure the session manager that will be used to create, destroy, and persist HTTP sessions for this web application. Normally, the default configuration of the session manager will be sufficient.
- Realm - Configure a realm that will allow its database of users, and their associated roles, to be utilized solely for this particular web application. If not specified, this web application will utilize the Realm associated with the owning Host or Engine.
- Resources - Configure the resource manager that will be used to access the static resources associated with this web application. Normally, the default configuration of the resource manager will be sufficient.
- WatchedResource - The auto deployer will monitor the specified static resource of the web application for updates, and will reload the web application if it is updated. The content of this element must be a string
-------------------------------------------------------------------------------------------------
关于TOMCAT 的内部概念定义 context 也是其中一种 详细查看文档 若是你想看tomcat源码的话也推荐有限了解这些概念
http://tomcat.apache.org/tomcat-7.0-doc/config/