1.如果一个工程里出现多个web.xml文件 每个web.xml文件都需对应一个index.jsp

Tomcat 404 error: The origin server did not find a current representation for the target resource or

添加完对应的index.jsp即可

2.servletTest文件夹sendToHello提交表单到HelloServlet、

Tomcat 404 error: The origin server did not find a current representation for the target resource or

HelloServlet在web.xml的映射没有使用/servletTest/hello,而是直接/hello。

Tomcat 404 error: The origin server did not find a current representation for the target resource or

这样会导致路径对不上,出现404错误。将路径改成完整的/servletTest/hello即可。

————————————————————分割线————————————————————

以上问题极为少见 ,大部分的404错误都是 url 路径写错或者新增了controller没有重新启动项目

相关文章: