1.点击idea中tomcat设置

2.点击deployment查看Deploy at the server startup 中tomcat每次所运行的包是 xxxx:war 还是其他,如果是xxxx:war包,请更换.点击旁边绿色加号,选择 xxxx:war exploded ,然后将 xxxx:war 点击红色删除掉

3.然后在server中 将 "On Update action"、"On frame deactivation" 都选择 update classes and resources

4.大功告成,已亲测,不用因为每次修改代码而重启了!