關於:thymeleaf報錯:
An error happened during template parsing (template: "class path resource [templates/hello.html]")] with root cause......
一下的每個都為單個的解決辦法! 並非步驟!
1.清除你編譯器編譯器緩存!並進行重啟
2.清除瀏覽器的緩存 ctrl+shift + del
3.檢查配置文件(.pom文件):是否包含依賴 如果沒有請添加!
<dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-thymeleaf</artifactId> </dependency>
4. 對application.properties中
#設置前綴和后綴
spring.thymeleaf.mode=HTML
spring.thymeleaf.suffix=.html
spring.thymeleaf.prefix=classpath:/templates/
5. 是否是編碼問題?我這里的編碼指的是代碼有錯誤 語法等問題 !