【发布时间】:2020-02-29 11:03:22
【问题描述】:
下面是我的控制器。如您所见,我想返回html 类型
@Controller
public class HtmlController {
@GetMapping(value = "/", produces = MediaType.TEXT_HTML_VALUE)
public Employee html() {
return Employee.builder()
.name("test")
.build();
}
}
我最初收到以下错误:
Circular view path [login]: would dispatch back to the current handler URL [/login] again
我通过关注this 帖子修复了它。
现在我收到另一个错误:
There was an unexpected error (type=Internal Server Error, status=500).
Error resolving template [], template might not exist or might not be accessible by any of the configured Template Resolvers
有人可以帮助我为什么我必须依靠 thymleaf 来提供 html 内容以及为什么会出现此错误。
【问题讨论】:
标签: java spring-boot thymeleaf