Spring ResponseStatusException不返回原因

Spring ResponseStatusException不返回原因,第1张

Spring ResponseStatusException不返回原因

答案由用户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错误页面内容



欢迎分享,转载请注明来源:内存溢出

原文地址: https://outofmemory.cn/zaji/5616172.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-12-15
下一篇 2022-12-15

发表评论

登录后才能评论

评论列表(0条)

保存