SpringBoot -- IDEA使用thymeleaf 时热加载

背景:

        因为之前使用的工具是eclipse,模板引擎在修改JSP页面的时候,项目是进行热加载的,不需要重启。但是idea的热加载方法不同

操作:

        在application.properties文件中添加属性值,禁用thymeleaf缓存

# 禁用缓存
spring.thymeleaf.cache=false 

SpringBoot -- IDEA使用thymeleaf 时热加载

         启动项目

SpringBoot -- IDEA使用thymeleaf 时热加载

         修改模板引擎页面

        随便加一些内容

SpringBoot -- IDEA使用thymeleaf 时热加载

        但是发现页面并没有修改,原因是我们文件虽然修改了,但是没编译SpringBoot -- IDEA使用thymeleaf 时热加载

 

 按ctrl+F9 ,对文件进行编译,编译完成后重新访问,修改生效,热加载成功 

SpringBoot -- IDEA使用thymeleaf 时热加载

上一篇:SpringBoot-thymeleaf-静态资源引入和接管


下一篇:Springboot+thymeleaf结合Vue,通过thymeleaf给vue赋值解决Vue的SEO问题