SpringBoot+Gradle+Freemarker报错,Check your ViewResolver setup

配置文件都对,报视图渲染错误:

Whitelabel Error Page

This application has no explicit mapping for /error, so you are seeing this as a fallback.

Fri May 05 18:52:50 CST 2017
There was an unexpected error (type=Internal Server Error, status=500).
Circular view path [login]: would dispatch back to the current handler URL [/login] again. Check your ViewResolver setup! (Hint: This may be the result of an unspecified view, due to default view name generation.)

检查后发现Jar包要用SpringBoot自带的Freemarker,不能用Freemarker官方的,在Gradle配置文件里将Jar包替换为

    compile 'org.springframework.boot:spring-boot-starter-freemarker'

问题解决。

posted @ 2017-05-05 19:02  海港余烟  阅读(4925)  评论(0编辑  收藏  举报