Context标签放置位置:
1.全局:$CATALINA_HOME/conf/context.xml
只能有一个???
2.全局:$CATALINA_HOME/conf/[enginename]/[hostname]/context.xml.default
enginename为catalina,hostname一般为localhost。 只能有一个???
3.局部:$CATALINA_HOME/conf/[enginename]/[hostname]/*.xml
.
enginename为catalina,hostname一般为localhost。 The name of the file (less the .xml extension) will be used as the context path. Multi-level context paths may be defined using #, e.g.
context#path.xml
. The default web application may be defined by using a file calledROOT.xml
.
4.局部:/META-INF/context.xml
if the previous file was not found for this application, in an individual file at
/META-INF/context.xml
inside the application files
5.全局:inside a Host element in the main conf/server.xml
(不推荐,原因如下)
For Tomcat 6, unlike Tomcat 4.x, it is NOT recommended to place <Context> elements directly in the server.xml file. This is because it makes modifing the Context configuration more invasive since the main |
Context属性值
path:表示web application的路径,如果是相对路径,是从server.xml的Host标签的appBase开始的。
docBase:表示网站或war文件的放置路径。如果是相对路径,是从server.xml的Host标签的appBase开始的。
reloadable:监视 classes in /WEB-INF/classes/
and /WEB-INF/lib
的改变,但是耗费资源。在生产环境中最好设置为false。reload行为可以在manager界面触发。