idea中的web.xml配置文件报错 Filter should have a mapping或者Server should have a mapping

idea中的web.xml配置文件报错 Filter should have a mapping或者Server should have a mapping

#今天做项目的时候烤了一个web.xml配置文件放到了另一个子工程中,结果就出现了如图所示的报错,Filter should have a mapping(而我已经在下面配置了filter-mapping),到网上找了一下,才发现是工程的web.xml位置配置错误,因为我是拷贝过来的文件,解决方法请看下边

报错工程截图
idea中的web.xml配置文件报错 Filter should have a mapping或者Server should have a mapping

解决方法

1 打开你的idea工程中的Project Structure
快捷键:Ctrl+Alt+Shift+S
或者点击File—Project Structure
idea中的web.xml配置文件报错 Filter should have a mapping或者Server should have a mapping

2 打开Project Structure之后,如图所示
1选择Modules
2选中对应工程下的Web
3点击右边的 +号 选择web.xml
idea中的web.xml配置文件报错 Filter should have a mapping或者Server should have a mapping

3选择web.xml之后,点击ok—apply----ok即可

idea中的web.xml配置文件报错 Filter should have a mapping或者Server should have a mapping
应用之后,web.xml文件就不会出现Filter should have a mapping爆红了,希望对你有所帮助
idea中的web.xml配置文件报错 Filter should have a mapping或者Server should have a mapping