thymeleaf自动刷新页面


导入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(重新编译当前页面)就是可以自动刷新页面了


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM