配置文件都對,報視圖渲染錯誤:
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'
問題解決。