Answer by Himadri Mandal for Spring Boot and custom 404 error page
Check if you have thymeleaf present in the classpath, or add below code and reimport the project. <dependency> <groupId>org.springframework.boot</groupId>...
View ArticleAnswer by Vipul Gulhane for Spring Boot and custom 404 error page
We have to add new @Controller public class MyErrorController implements ErrorController { @RequestMapping("/error") public String handleError(HttpServletRequest request) { Object status =...
View ArticleAnswer by sujoydutta for Spring Boot and custom 404 error page
Thymeleaf can handle error without a controller. create error.html to resources folder.
View ArticleAnswer by OlgaMaciaszek for Spring Boot and custom 404 error page
If you are using Thymeleaf like suggested in the question, you could use a template similar to the one from the previous reply, but appropriate for Thymeleaf rather than Freemarker. I have also added...
View ArticleAnswer by GoutamS for Spring Boot and custom 404 error page
You're using Thymeleaf, And Thymeleaf can handle error without a controller. For a generic error page this Thymeleaf page need to be named as error.html and should be placed under src/main/resources...
View ArticleAnswer by Naiyer for Spring Boot and custom 404 error page
There is no need for the EmbeddedServletContainerCustomizer bean. Simply putting the corresponding error page (such as 404.html in case of 404) in the public directory should be enough (as pointed by...
View ArticleAnswer by brunoid for Spring Boot and custom 404 error page
In Spring Boot 1.4.x you can add a custom error page: If you want to display a custom HTML error page for a given status code, you add a file to an /error folder. Error pages can either be static HTML...
View ArticleAnswer by Ali Dehghani for Spring Boot and custom 404 error page
new ErrorPage(HttpStatus.NOT_FOUND, "/404.html") That /404.html represents the URL Path to Redirect, not the template name. Since, you insist to use a template, you should create a controller that...
View ArticleSpring Boot and custom 404 error page
In my Spring Boot application, I'm trying to configure custom error pages, for example for 404, I have added a following Bean to my application configuration: @Bean public...
View ArticleAnswer by pranav patil for Spring Boot and custom 404 error page
enter image description hereIt's very easy to do in Spring Boot Application. Spring Boot all most done all thing for us.1)In Path src/main/resources/templates make folder which has name 'error'2)Next...
View Article
More Pages to Explore .....