1. 程式人生 > >spring boot 踩坑日記: Error resolving template "index", template might not exist or might not be accessi

spring boot 踩坑日記: Error resolving template "index", template might not exist or might not be accessi

訪問index時報錯:

org.thymeleaf.exceptions.TemplateInputException: Error resolving template "index", template might not exist or might not be accessible by any of the configured Template Resolvers
    at org.thymeleaf.TemplateRepository.getTemplate(TemplateRepository.java:246) ~[thymeleaf-2.1.6.RELEASE.jar:2.1.6.RELEASE]
 

pom.xml新增依賴:

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

意思是找不到index頁面,index所在目錄不對,改成正確的就行了

還不行的話改成templates