I'm using spring-boot 2.1.3 and I want to add an error page as a fallback. I tried adding an error.html under the templates folder but it didn't work.
Also tried to add ErrorController and classify a page for each error type and it didn't work either.
Are there any other configurations that I should make?
Thanks in advance.
The only thing I can think of (without any code sample provided) is that /error might not have permission to view. Please try to set the permission in SecurityConfigurations to allow /error to be accessed by all.
http.authorizeRequests().antMatchers("/error").permitAll();
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With