- Mastering Spring Boot 2.0
- Dinesh Rajput
- 179字
- 2021-06-25 21:29:16
Customizing application error pages
Every application has a chance of encountering an error, even if it is an extremely robust application. So, designing custom error pages is important for any enterprise application. Spring Boot applications provide a default error page. You can see one in the following screenshot:

But if you want to use a custom error page for a given status code, you can add a file to the /error folder. You can create a custom error page by using static HTML, FreeMarker, Velocity, Thymeleaf, JSP, and so on. The name of the file should be the exact status code or a series mask.
Let's see the following image to map 404 to a static HTML file; your folder structure would be as follows:

As you can see, I have added a custom 404 error page (static error page 404.html) under the /resource/public/error directory; see the following output from the error page:

As you can see, Spring Boot now displays a custom error page instead of the default WhiteLabel error page as part of auto-configuration.
- Excel 2019公式與函數應用大全(視頻教學版)
- Excel 2010中文版完全自學手冊
- Word/Excel/PPT 2013辦公應用從入門到精通
- 辦公自動化軟件
- Unity 2018 AR與VR開發快速上手
- 從零開始學Excel 2010
- 高效隨身查:PPT2021必學的美化設計應用技巧(視頻教學版)
- MATLAB R2020a完全自學一本通
- Excel 2013從新手到高手(超值版)
- Excel 2013財務管理應用全流程實戰指南
- 中文PowerPoint 2003應用基礎
- Excel技術與應用大全
- Excel數據處理與統計初步(第4版)
- 新編PowerPoint 2016從入門到精通
- 辦公自動化綜合案例應用教程