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没有重新启动项目

相关文章:

  • 2021-08-07
  • 2021-10-03
  • 2021-04-11
  • 2021-06-28
  • 2021-08-02
  • 2021-07-23
  • 2021-04-21
  • 2021-09-15
猜你喜欢
  • 2021-11-28
  • 2021-04-30
  • 2021-09-26
  • 2021-11-05
  • 2021-09-30
相关资源
相似解决方案