惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

D
DataBreaches.Net
罗磊的独立博客
雷峰网
雷峰网
量子位
V
Visual Studio Blog
Vercel News
Vercel News
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
The Cloudflare Blog
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
宝玉的分享
宝玉的分享
月光博客
月光博客
Martin Fowler
Martin Fowler
aimingoo的专栏
aimingoo的专栏
H
Hackread – Cybersecurity News, Data Breaches, AI and More
Microsoft Security Blog
Microsoft Security Blog
博客园 - 叶小钗
腾讯CDC
Engineering at Meta
Engineering at Meta
博客园 - Franky
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
Y
Y Combinator Blog
Recent Announcements
Recent Announcements
Jina AI
Jina AI
A
About on SuperTechFans

博客园 - James.H.Fu

PMS-授权中心 如何从现有版本1.4.8升级到element UI2.0.11 Maven私有仓库: 发布release版本报错:Return code is: 400, ReasonPhrase: Repository does not allow upd ating assets: maven-releases. spring boot + dubbo开发遇到过的异常 java,javascript中的url编码 SpringBoot favicon.ico SpringBoot 异常处理 spring boot 跨域请求 在centos 7上安装BIMServer maven 单独构建多模块项目中的单个模块 MongoDB 安装及副本集简单操作 spring-boot dubbo项目使用docker方式部署 Spring Boot和Dubbo整合 Maven私有仓库-使用docker部署Nexus - James.H.Fu - 博客园 centos7 sentry部署指南 静态文件服务器部署指南 开始使用ansible 2016项目开发经验总结及后续计划 - James.H.Fu - 博客园 2016工作总结
springboot 定制错误页面
James.H.Fu · 2017-08-25 · via 博客园 - James.H.Fu

项目中经常遇到的异常情况

  • 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

定制错误页面的方法

  1. 在src/main/resource/templates/error/目录中增加
  2. 在src/main/resource/public/error/目录中增加

其中第一种方式的优先级大于第二种。
springboot-error-handling

参考文档

——致力于微软企业解决方案、项目管理及技术培训

posted on 2017-08-25 18:32  James.H.Fu  阅读(522)  评论()    收藏  举报