導入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(重新編譯當前頁面)就是可以自動刷新頁面了