SpringBoot中的thymeleaf引擎報錯


關於: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. 是否是編碼問題?我這里的編碼指的是代碼有錯誤 語法等問題 !




免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM