我在Tomcat上使用了一个https:abc:8443/appname/login
应用程序。我已经配置了应用程序,这样如果我搜索https://abc:8443/appname/prasfag.txt
,就会显示我的自定义错误页面。
但是,如果我搜索https://abc:8443/prags.txt
,tomcat会显示默认的错误404页面。我希望tomcat在我访问https://abc:8443/prags.txt
时显示一个自定义页面。
如何配置?
在tomcat web.xml中,您可以配置HTTP重定向页面。只需插入
<error-page>
<error-code>-xxx-</error-code>
<location>/your/custom/html/path.html</location>
</error-page>
在您的web.xml 中