template might not exist or might not be accessible by any of the configured Template Resolvers

错误信息:Error resolving template “login.html”
template might not exist or might not be accessible by any of the configured Template Resolvers_第1张图片
1、查找了login.html文件是存在的,首先要确定项目是否编译出target文件及静态资源和视图文件
template might not exist or might not be accessible by any of the configured Template Resolvers_第2张图片
2、检查配置文件,没有问题
template might not exist or might not be accessible by any of the configured Template Resolvers_第3张图片

3、maven依赖没有问题:



 
            org.springframework.boot
            spring-boot-starter-thymeleaf
        
        
            org.thymeleaf
            thymeleaf
            3.0.9.RELEASE
        
        
            org.thymeleaf
            thymeleaf-spring4
            3.0.9.RELEASE
        



        
            
                org.springframework.boot
                spring-boot-maven-plugin
            
            
                org.mybatis.generator
                mybatis-generator-maven-plugin
                1.3.2
                
                    src/main/resources/generatorConfig.xml
                    true
                    true
                
            
        
        
        
        
            
                src/main
                
                    **/*.properties
                    **/*.xml
                
            
        
    

4、检查视图跳转WebMvcConfigurer
template might not exist or might not be accessible by any of the configured Template Resolvers_第4张图片因为其他项目都是这样配置的,所以没太在意这部分,多次检查才发现是路径有误:
template might not exist or might not be accessible by any of the configured Template Resolvers_第5张图片

改为:
template might not exist or might not be accessible by any of the configured Template Resolvers_第6张图片
重启访问成功

你可能感兴趣的:(springboot)