Context标签配置

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 called ROOT.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 conf/server.xml file cannot be reloaded without restarting Tomcat.

 

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界面触发。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值