This is quite common error in spring boot application which says 404(page not found).
We can mostly resolve this in 3 ways :
Custom Error Controller : where you will be implementing ErrorController
interface which is provided by SpringFramework
and then overriding its getErrorPath()
so that you can return a custom path whenever such type of error is occurred.
By Displaying Custom error page : All you have to do is create an error.html
page and place it into the src/main/resources/templates path
. The BasicErrorController
of of springboot will automatically pick this file by default.
By disabling the whitelabel error page : This is the easiest way where all you need to do is server.error.whitelabel.enabled
property to false in the application.properties
file to disable the whitelabel error page.