【发布时间】:2020-05-01 05:25:15
【问题描述】:
您好,我正在尝试在 thymeleaf 项目中通过在模板中添加 404.html 页面来添加自定义错误页面。
但是当我输入 localhost:8080/RandomUrl-doesn't-that-exist 我有标准错误 404 消息。
我的配置:
#for Spring Boot 2.0
spring.autoconfigure.exclude=org.springframework.boot.autoconfigure.web.servlet.error.ErrorMvcAutoConfiguration
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-thymeleaf</artifactId>
</dependency>
Solution : don't remove whitelabel message in applications.properties
【问题讨论】:
标签: spring-boot thymeleaf