Error resolving template [index], template might not exist

Problem: error resolving template [index], template may not exist
Solution:
1. Check the project structure first and check whether the location of the static resource file is misplaced

2. Check if the thymeleaf dependency in pom.xml is imported correctly
At first, I only imported the following dependencies, but it reported an error

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

3. Change to the following, just download it again

<!--        thymeleaf -->
        <dependency>
            <groupId>org.thymeleaf</groupId>
            <artifactId>thymeleaf-spring5</artifactId>
        </dependency>
        <dependency>
            <groupId>org.thymeleaf.extras</groupId>
            <artifactId>thymeleaf-extras-java8time</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-thymeleaf</artifactId>
        </dependency>

Read More: