tomcat的热加载与热部署

名词解释:

热部署 autoDeploy : 当context XML改变的时候,会直接部署到tomcat上,而不用重启tomcat。假设tomcat下面多加了一个应用,tomcat会自动部署这个应用,不用重新启动。

     autoDeploy:This flag value indicates if Tomcat should check periodically for new or updated web applications while Tomcat is running. If true, Tomcat periodically checks the appBase and xmlBase directories and deploys any new web applications or context XML descriptors found. Updated web applications or context XML descriptors will trigger a reload of the web application. The flag's value defaults to true. See Automatic Application Deployment for more information.

热加载 reloadable : 如果【/WEB-INF/classes/】或者/WEB-INF/lib 下面有变化,tomcat会重新加载整个web应用。

  reloadable:Set to true if you want Catalina to monitor classes in /WEB-INF/classes/ and /WEB-INF/lib for changes, and automatically reload the web application if a change is detected. This feature is very useful during application development, but it requires significant runtime overhead and is not recommended for use on deployed production applications. That's why the default setting for this attribute is false. You can use the Manager web application, however, to trigger reloads of deployed applications on demand.

 

实现热加载的方式

修改的文件:apache-tomcat/conf/server.xml 

修改内容:标签中添加 如下 标签 

<Context debug="0" path="/platform" docBase="D:/tomcat-7.0.68/webapps/platform" reloadable="true"/>

解释: 

debug:表示log中记录异常的控制等级,数值越大,记录越详细。 
path:   访问目录 此例即 127.0.0.1/mytest/ 
docBase:项目目录 可以为绝对路径(注意 ‘/’ 方向),也可以为相对路径(相对 webapps ,此例 docBase=”/mytest”) 
reloadable:字面意思可看出,是否加载新的class文件,实现热加载。

autoDeploy="true"    ----  自动部署

 

 

转载:http://blog.csdn.net/elapse008/article/details/51804473

转载于:https://www.cnblogs.com/alisonGavin/p/7146072.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值