Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Spring boot 2.1 error.html page not showing [duplicate]

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.

like image 440
motawfik Avatar asked Dec 07 '25 10:12

motawfik


1 Answers

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();
like image 109
Vinay Limbare Avatar answered Dec 10 '25 00:12

Vinay Limbare