SpringBoot thymeleaf遇到的坑

最近在作全局异常处理,能够根据请求方式返回不一样类型异常信息,json返回的彻底无问题,结构碰到返回页面的死活都是永恒的错误页面html

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

null
There was an unexpected error (type=null, status=null).

开始仍是一脸懵逼,后来在父项目依赖管理上找到缘由,指定了spring-boot-starter-thymeleaf 的版本和使用的SpringBoot 2.1.0.RELEASE 不支持。 建议 spring-boot-starter-thymeleaf和spring-boot-starter-web 默认不指定版本。web

添加“parent”标签里的内容后,“spring-boot-starter-parent”会为开发者提供经常使用jar的版本管理,因此咱们不须要指定版本,使用人家提供好的就能够了。固然,指定也是能够的,这会覆盖官方默认的版本,不推荐spring

相关文章
相关标签/搜索