springboot 定制错误页面
项目中经常遇到的异常情况
- 400-Bad Request
- 401-Unauthorized
If the request already included Authorization credentials, then the 401 response indicates that authorization has been refused for those credentials.
- 403-Forbidden
The server understood the request, but is refusing to fulfill it.
- 404-Resource not found
- 500-Internal Server Error
定制错误页面的方法
- 在src/main/resource/templates/error/目录中增加
- 在src/main/resource/public/error/目录中增加
其中第一种方式的优先级大于第二种。
参考文档
——致力于微软企业解决方案、项目管理及技术培训
posted on 2017-08-25 18:32 James.H.Fu 阅读(515) 评论(0) 编辑 收藏 举报