需要在server.xml中做以下配置:

在host节点内加入<Context>标签,reloadable属性设置为true。

      <Host name="localhost"  appBase="webapps"
            unpackWARs="true" autoDeploy="true">
               <Context path="/" docBase="vcsys-client" debug="99" reloadable="true" />
      </Host>

测试一下:

1、正常启动tomcat后访问接口:

tomcat 热替换class

2、修改类:

tomcat 热替换class

3、将修改后的class替换tomcat/webapps/下的对应class

tomcat 热替换class

4、测试修改是否生效:

tomcat 热替换class

 

相关文章:

  • 2021-10-27
  • 2022-12-23
  • 2021-07-10
  • 2022-12-23
  • 2021-10-20
  • 2022-12-23
  • 2021-12-11
猜你喜欢
  • 2021-09-15
  • 2021-08-05
  • 2021-12-06
  • 2022-01-06
  • 2022-12-23
  • 2022-03-07
  • 2021-08-16
相关资源
相似解决方案