如何覆盖“没有找到网址的网页”消息?

时间:2018-05-10 13:14:12

标签: java spring security spring-boot tomcat

“找不到网址的网页:https://localhost/blabla消息是作为对具有非法路径的请求的响应而生成的。我需要返回一个自定义消息而不是这个消息。知道怎么做吗?

服务器嵌入了Tomcat

spring-boot-starter-tomcat-1.3.3.RELEASE.jar
spring-webmvc-4.2.5.RELEASE.jar

1 个答案:

答案 0 :(得分:0)

您可以更新httpd.conf并指向新页面maintenance.html(将其称为任何内容)并将其放置在可以访问的位置。

// comment anything existing add line below
ErrorDocument 503 /maintenance.html