1. 程式人生 > >Error_template might not exist or might not be accessible by any of the configured Template Resolver

Error_template might not exist or might not be accessible by any of the configured Template Resolver

    錯誤提示為:

          Error resolving template "login.html", template might not exist or might not be accessible by any of the configured Template Resolvers。 

     解決方法:

            (1)首先檢查自己是否匯入:thymeleaf包;

                    <dependency>

                             <groupId>org.springframework.boot</groupId>

                             <artifactId>spring-boot-starter-thymeleaf</artifactId>

                   </dependency>

 

              (2)其次檢查自己是否在配置起始頁面的位置給頁面名稱前面加“/”有的話去掉。

 

               (3)檢查自己是否在yml或者properties中配置thymeleaf

                        thymeleaf:

                               cache: false

                               encoding: utf-8

                               mode: HTML5

                               prefix: classpath:/templates/

                               suffix: .html

                問題很小,希望能夠幫到你。