idea工程中web.xml报错Servlet should have a mapping

搭建ssm工程过程中web.xml报错:Servlet should have a mapping ....但是mapping已经配置好了...如下图:

 

搜索无果,后来发现是工程的web.xml位置配置错误,因为我之前换过根目录位置。 
修改方法: 
打开Project Structure界面,Modules>Web>Deployment descriptor,修改正确的位置即可,如下图:

 

另:打开Project Structure的方法: 
Ctrl+Alt+Shift+S

除上述以外,一定要注意web.xml存放的路径,其必须在WEB-INF目录中
---------------------
参考:

https://blog.csdn.net/lydong_/article/details/79812545
http://www.itdadao.com/articles/c15a1162290p0.html

原文地址:https://www.cnblogs.com/alice-cj/p/10412317.html