Config The Context on Tomcat

1: You can config the Context in place of below:

i:$CATALINA_BASE/conf/context.xml

ii:$CATALINA_BASE/conf/[enginename]/[hostname]/context.xml.default

iii:$CATALINA_BASE/conf/[enginename]/[hostname]/[contextPath].xml

iv:$APPLICATION/META-INF/context.xml 

v: $CATALINA_BASE/conf/server.xml


2: Not to recommend to config Context in server.xml . The reason can look at http://tomcat.apache.org/tomcat-6.0-doc/config/context.html

3:  i and ii above is common type . you can not config the private information (example:  docBase and path ) on here . (if  you  add the docBase or path attribute that it will be ignore . i think maybe throw exception when tomcat startup if you add some particular attribute . But i not sure). That is logical , because you should not set a  path attribute for a particular application in common configuration .

4: iii above is private type . The Context configuration on here that correspond a particular application . so you can config the private attribute ,example docBase and path . All attribute on here will override the common Context configuration (i just test some attribute of context element but not all . But i think  all attribute will be override ).

5: iv above is private type too. The Context configuration on here that correspond current application . so you no need to specify the docBase and path attribute . the value of path is application's name. if you specify the doBase or path that  will be ignore .Note: this context.xml will be copy  to $CATALINA_BASE/conf/[enginename]/[hostname]/ and rename to [application's name].xml . Once this file exists, it will not be replaced if a new application with the same name and with /META-INF/context.xml file. The file will not be delete automatically if you undeploy the application.

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值