在Visual Studio中开发时我们很习惯在编辑完页面文件后就可以立即刷新页面进行查看,但是使用IntelliJ IDEA配合Tomcat时发现编辑完页面后页面并不会更新,这里我找到一些办法通过设置达到相似的效果。

首先在项目中需要有配置Artifacts,在Project Structure的Artifacts中增加Web Application: Exploded => From Modules...

IntelliJ IDEA中web开发热部署

 

接下来在 Run ==> EditConfigguration 界面配置Tomcat Server的Server界面中的On 'Update' action与On frame deactivation中选择Update resources

IntelliJ IDEA中web开发热部署

 

在Deployment中配置

IntelliJ IDEA中web开发热部署

 

接下来启动IDEA的自动编译功能,在Setting中找到“Build,Execution,Deployment” => Compiler中勾选Build Project automatically

IntelliJ IDEA中web开发热部署

 

开启项目运行时自动build,在打开的页面上快捷键ctrl + shift + a 搜索命令:registry –> 勾选 compiler.automake.allow.when.app.running

IntelliJ IDEA中web开发热部署

IntelliJ IDEA中web开发热部署

 

相关文章:

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