idea创建struct2项目web.xml文件报错(Cannot resolve class ‘StrutsPrepareAndExecuteFilter‘)

idea创建struct2项目web.xml文件报错
出错图如下:
idea创建struct2项目web.xml文件报错(Cannot resolve class ‘StrutsPrepareAndExecuteFilter‘)
它会显示Cannot resolve class 'StrutsPrepareAndExecuteFilter’的错误,通过网络查查尝试了版本更换等操作,均一失败而告终。将所需要的jar包放在WEB-INF中新建一个lib中也不能解决。

解决方法:
使用idea新建一个module,将Web Application勾选上,同时将将下方Structs2勾选,选择下方的User library 选择创建,

idea创建struct2项目web.xml文件报错(Cannot resolve class ‘StrutsPrepareAndExecuteFilter‘)
将事先下载好的jar文件选中,点击ok,就会出现Structs2的lib库。
idea创建struct2项目web.xml文件报错(Cannot resolve class ‘StrutsPrepareAndExecuteFilter‘)

工程随便命名,点击finish即可。
idea创建struct2项目web.xml文件报错(Cannot resolve class ‘StrutsPrepareAndExecuteFilter‘)

新建工程出现struct.xm文件,同时web.xml文件不在报错。
idea创建struct2项目web.xml文件报错(Cannot resolve class ‘StrutsPrepareAndExecuteFilter‘)
在配置strct.xml文件时,为了能有标签提示。选择setting,选择XML Catalog选择struts-2.3.dtd等版本的dtd文件即可。
idea创建struct2项目web.xml文件报错(Cannot resolve class ‘StrutsPrepareAndExecuteFilter‘)
效果图如下:
idea创建struct2项目web.xml文件报错(Cannot resolve class ‘StrutsPrepareAndExecuteFilter‘)