首页 > 技术文章 > idea中web.xml报错 Servlet should have a mapping

thinkingandworkinghard 2017-04-16 09:49 原文

配置springmvc时,报错,实际mapping已经写了,错误截图如下:itdadao

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

ps:打开Project Structure的方法: 
1、在单机工程名,按F4 
2、Ctrl+Shift+a,输入Project Structure进行搜索

 

转载:http://www.itdadao.com/articles/c15a1162290p0.html

推荐阅读