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