使用idea启动tomcat报404 The origin server did not find a current representation for the targe

问题描述
使用idea启动tomcat报404 The origin server did not find a current representation for the targe
参考总结下二文档
https://blog.****.net/su330494482/article/details/80718443
https://www.cnblogs.com/Survivalist/p/8979929.html

1、 首先,右击项目,点击 open module settings
使用idea启动tomcat报404 The origin server did not find a current representation for the targe
2、 配置 project,主要是本地 jdk 的安装路径,还有项目编译输出的路径
使用idea启动tomcat报404 The origin server did not find a current representation for the targe
3、 配置 modules ,其中 paths 定位到 web-inf/classes ;dependencies 加入jdk和项目 web-inf/lib
使用idea启动tomcat报404 The origin server did not find a current representation for the targe
paths 定位到 web-inf/classes
使用idea启动tomcat报404 The origin server did not find a current representation for the targe
dependencies 加入jdk和项目 web-inf/lib。其实下面这一步,只需要把相关的包导入,代码不报错就ok,反正当时我在这里的设置,并没有做什么,就在外部找到jar包然后右击执行 Add as Libraries。如果有红色报错的包就删除它,其实不用做太多操作
使用idea启动tomcat报404 The origin server did not find a current representation for the targe

4、 配置 libraries ,点击 + 号,选择 java ,然后还是选择你项目的 web-inf/lib。这一步也可以在外部找到jar包然后右击执行 Add as Libraries,总之不要让代码缺失包而报错即可。也可以点“+“选择java找你的项目把项目中的lib文件导入
使用idea启动tomcat报404 The origin server did not find a current representation for the targe
5、 配置 facets ,此步很重要,配置 web resource directories ,路径配错,就会报 404 ,一定要定位到项目根目录,也就是下面有整个项目源码的地方。注意:这一步配置很重要,我就是在这里出错搞了两天
使用idea启动tomcat报404 The origin server did not find a current representation for the targe
然后就会出下图所示的相关信息
使用idea启动tomcat报404 The origin server did not find a current representation for the targe
使用idea启动tomcat报404 The origin server did not find a current representation for the targe
6、 配置 artifacts ,此步选择第二个,选择你的项目即可
使用idea启动tomcat报404 The origin server did not find a current representation for the targe
注:这有一步很重要,在添加完以后,一定要选中你的项目,然后鼠标左键Put into Output Root一下
使用idea启动tomcat报404 The origin server did not find a current representation for the targe
将项目添加到tomcat中
1、
使用idea启动tomcat报404 The origin server did not find a current representation for the targe
2、
使用idea启动tomcat报404 The origin server did not find a current representation for the targe
3、然后产生如下图所示界面
使用idea启动tomcat报404 The origin server did not find a current representation for the targe
使用idea启动tomcat报404 The origin server did not find a current representation for the targe
使用idea启动tomcat报404 The origin server did not find a current representation for the targe
使用idea启动tomcat报404 The origin server did not find a current representation for the targe
如此配置完成,启动项目即可