Skip to content

What is the Whitelabel error page? 

Programming frameworks are becoming more popular today as they allow developers to quickly build and deploy rather large-scale apps without having to do everything themselves. That said, they often have a rather steep learning curve, so running into errors is inevitable. 

In this article, we’re looking at the Spring Boot Whitelabel error page, its causes and what you can do to fix the problem.

What is the Whitelabel error page?

The Whitelabel error page is a generic Spring Boot error page displayed when no custom error page is present. Why you might see an error page like this depends on the specific error in your app. 

You can use this page to catch and display any errors in your app to the user as it provides a quick way of reporting client-end errors without having to write a custom page for each issue. However, you can replace it with a custom page that works within the same template but integrates better with your overall app’s design.

Also read: How to fix ‘Java: compilation failed: internal java compiler error’?

How to fix this?

The easiest way to fix this error is to disable the Whitelabel error page and providing a custom replacement instead. 

Disabling the Whitelabel error page prevents it from being shown when your app runs into an error. You can do this in the file by changing the server.error.whitelabel.enabled flag to false. 


Alternatively, you can disable the error page by excluding the ErrorMvcAutoConfiguration class. 

@SpringBootApplication(exclude = {ErrorMvcAutoConfiguration.class})
public class Application {
                           //code goes here

Do keep in mind that if you disable the Whitelabel error page and no custom page is provided as a replacement, the web server’s default error page is shown. 

Also read: Phone won’t make calls but I can text: 9 Fixes

Hello There!

If you like what you read, please support our publication by sharing it with your friends, family and colleagues. We're an ad-supported publication. So, if you're running an Adblocker, we humbly request you to whitelist us.

We may earn a commission if you buy something from a link on this page. Thanks for your support.