故意把访问项目名称写错。
解决方法:
在tomcat的conf文件夹里面的web.xml文件的这个节点<web-app></web-app>里面加就行了:
加上<error-page>
<error-code>404</error-code>
<location>/index.jsp</location>
</error-page>
加上<error-page>
<error-code>404</error-code>
<location>/index.jsp</location>
</error-page>
index.jsp页面就是在tomcat的root文件夹下的页面;

本文介绍如何在 Tomcat 中为 404 错误页面设置自定义显示页面,通过修改 conf 文件夹内的 web.xml 文件实现错误页面重定向至 index.jsp,适用于希望优化用户体验的开发者。
9347

被折叠的 条评论
为什么被折叠?



