- 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/PowerPoint 2013三合一高效辦公超級(jí)手冊(cè)
- 五筆打字精品教程
- 從原始數(shù)據(jù)到分析報(bào)告:Excel數(shù)據(jù)透視表高效達(dá)人養(yǎng)成記
- Linux操作系統(tǒng)與服務(wù)配置
- 和秋葉一起學(xué):秒懂Excel(全彩版)
- 高效能辦公必修課:Excel數(shù)據(jù)處理
- Word/Excel/PPT/PS/移動(dòng)辦公Office 5合1無(wú)師自通
- 新編Excel 2010從入門(mén)到精通
- 和秋葉一起學(xué):秒懂Excel
- 零基礎(chǔ)學(xué)Python
- 新編電腦選購(gòu)、組裝、維護(hù)與故障處理從入門(mén)到精通
- 精通Excel數(shù)據(jù)統(tǒng)計(jì)與分析
- 精通Excel數(shù)據(jù)統(tǒng)計(jì)與分析
- 一看即會(huì):新手學(xué)網(wǎng)上開(kāi)店與經(jīng)營(yíng)(超值視頻教學(xué)版)
- 如何高效辦公:Excel 2013經(jīng)典應(yīng)用技巧大全