The thymeleaf engine in springboot reports an error [Solved]

Error reported by thymeleaf:

An error happened during template parsing (template: “class path resource [templates/hello.html]”)] with root cause……

Each of the following is a single solution! Not a step

1. Clear your compiler cache! And restart

2. Clear the browser cache Ctrl + Shift + Del

3. Check the configuration file (. POM file): whether it contains dependencies. If not, please add it

 <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-thymeleaf</artifactId>
        </dependency>

4. In application. properties

#Set prefix and suffix
spring.thymeleaf.mode=HTML
spring.thymeleaf.suffix=.html
spring.thymeleaf.prefix=classpath:/templates/

5. Is it a coding problem? The code here refers to the code with errors, syntax, and other problems

 

Similar Posts: