该答案由用户Hassan在原始问题的评论中提供。我只是将其发布为答案,以使其具有更好的可见性。
基本上,您所需要做的就是添加
server.error.include-message=always到application.properties文件中,现在应该填充您的消息字段。
在Spring Boot 2.3中已更改了此行为,您可以在此处阅读以下内容:https : //github.com/spring-projects/spring-
boot/wiki/Spring-Boot-2.3-Release-Notes#changes-to-the-
default错误页面内容
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)