且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何始终返回index.html TomCat

更新时间:2023-11-17 22:56:34

基本上,您必须在tomcat目录的conf文件夹中更改web.xml文件。
$ CATALINA_HOME / conf / web.xml

Basically you have to change web.xml file inside conf folder of tomcat directory. $CATALINA_HOME/conf/web.xml

<error-page> 
    <error-code>404</error-code>
    <location>/error/index.html</location>
</error-page>

并添加一个具有该页面的Web应用程序,并将在给定位置下回答URL。

And add a webapp that has the page and will answer to the URL under given location.