版权声明:本文为博主原创文章,未经博主允许不得转载,如需帮助请qq联系1016258579,或者关注公众号 程序员日常锦集 ” 。 https://blog.csdn.net/weixin_38361347/article/details/89857353
禁用tomcat管理界面
默认访问webapps下root文件 可以新建一个空的root文件即可,然后添加相应的404页面,在web.xml中进行配置
在web.xml中添加配置:
<error-page>
<exception-type>java.lang.Exception</exception-type>
<location>/404.html</location>
</error-page>
<error-page>
<error-code>404</error-code>
<location>/404.html</location>
</error-page>
<error-page>
<error-code>400</error-code>
<location>/404.html</location>
</error-page>
<error-page>
<error-code>500</error-code>
<location>/404.html</location>
</error-page>
404页面自己提供即可。
然后放置在webapps root 目录下面即可。