首页 > 其他 > 详细

thymeleaf自动刷新页面

时间:2021-03-02 14:43:50      阅读:74      评论:0      收藏:0      [点我收藏+]

导入thymeleaf依赖、热部署依赖devtools使页面实时生效

<dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-devtools</artifactId>
</dependency>

<dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-thymeleaf</artifactId>
</dependency>

  

html\首页资源\index放到gulimall-product下的static文件夹

把index.html放到templates中

关闭thymeleaf缓存,方便开发实时看到更新

 thymeleaf:
    cache: false
    suffix: .html
    prefix: classpath:/templates/

  关于页面自动刷新,导入上面的tool工具后,每次修改页面idea工具栏上面的ctrl+f9(重新编译)或者ctrl+shift+f9(重新编译当前页面)就是可以自动刷新页面了

thymeleaf自动刷新页面

原文:https://www.cnblogs.com/vincentmax/p/14468293.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!