springboot整合freemarker找不到页面

1.查看application.properties

spring.freemarker.cache=false
spring.freemarker.charset=UTF-8
spring.freemarker.check-template-location=true
spring.freemarker.content-type=text/html
spring.freemarker.expose-request-attributes=true
spring.freemarker.expose-session-attributes=true
spring.freemarker.request-context-attribute=request
spring.freemarker.tempalte-loader-path=classpath:/templates
spring.resources.static-locations=classpath:/templates/,classpath:/static/,classpath:/resources/static/
spring.mvc.static-path-pattern=/static/**
spring.freemarker.suffix=.ftl

2.controller要在启动类的同级或子级的包下

3.查看pom.xml,加上**/*.ftl


            
                src/main/resources
                
                    *.properties
                    *.xml
                    **/*.html
                    **/*.ftl
                    static/**
                
                true
            

你可能感兴趣的:(springboot,spring,boot)