了方便每次修改HTML文件都能实时刷新,做一下更改。
在application.properties文件加入以下命令:
#thymeleaf start spring.thymeleaf.mode=HTML5 spring.thymeleaf.encoding=UTF-8 spring.thymeleaf.content-type=text/html #开发时关闭缓存,不然没法看到实时页面 spring.thymeleaf.cache=false #thymeleaf end
如下所示:
打开IDEA->File->setting,勾选自动编译
使用快捷键ctrl+alt+shift+/,选择选项Registry,勾选自动编译
然后重启项目,更改HTML文件后ctrl+s保存后,刷新页面即可看到更新。