zoukankan      html  css  js  c++  java
  • 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

  • 相关阅读:
    URL中传参带有%2F等特殊字符
    js根据对象数组中某一属性值,合并相同项,并对某一属性累加处理
    windows传输文件到linux
    npm 切换源
    linux下安装java
    PowerShell:因为在此系统上禁止运行脚本,解决方法
    wget: 未找到命令
    发货通知单禁止手工新增
    固定提前期
    容差码
  • 原文地址:https://www.cnblogs.com/alisonGavin/p/7146072.html
Copyright © 2011-2022 走看看