【发布时间】:2019-08-17 14:34:29
【问题描述】:
根据文档,我为 Spring Boot 应用程序 404.html 编写了一个自定义错误页面,并将此文件放在 src/main/resources/public/error/404.html 中。我的 application.properties 文件也包含“server.error.whitelabel.enabled=false”。现在在 localhost 上,这个 404.html 被渲染,但是当部署在服务器上时,这个页面不会渲染,而是显示 tomcat HTTP 404 错误页面。谁能建议我如何解决这个问题。
PS : 文件 404.html, 404.css 在服务器上部署的战争中被捆绑在 WEB-INF 文件夹中。
【问题讨论】:
标签: spring-boot tomcat custom-error-pages