错误描述:404,源服务器未能找到目标资源的表示或者是不愿公开一个已经存在的资源表示。
之前在本地IDEA环境测试正常,且该页面之前从菜单链接访问是正常的
1、在tomcat的webapps目录对应项目目录下新增WEB-INF文件,并在WEB-INF目录下新建web.xml文件
2.web.xml内容
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns="http://xmlns.jcp.org/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee
http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd"
version="3.0" metadata-complete="true">
<display-name>Router for Tomcat</display-name>
<error-page>
<error-code>404</error-code>
<location>/index.html</location>
</error-page>
</web-app>