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.大功告成,已親測,不用因為每次修改代碼而重啟了!