- 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.
- Word/Excel/PPT 2013辦公應用從入門到精通
- 用友ERP-U8(8.72版)標準財務模擬實訓
- Excel 2007函數與公式實戰技巧精粹
- 從零開始學PowerPoint 2010
- 非常Easy:Excel高效辦公
- Salesforce Platform Developer I Certification Guide
- Office 2007辦公軟件應用立體化教程
- WPS Office辦公應用從入門到精通
- 中文PowerPoint 2003應用基礎
- 現用現查:電腦BIOS/注冊表設置實戰秘籍
- Word/Excel/PowerPoint 2013三合一辦公應用
- PPT制作應用大全
- 快速編碼:高效使用MicrosoftVisualStudio
- Excel人力資源管理必備的200個文件
- IT審計:用SQL+Python提升工作效率