idea-web.xml版本过低怎么生成新的(web.xml报错)


版本:

一、版本过低,web.xml报错,报错信息为:

The content of element type "web-app" must match "(icon?,display-name?,description?,distributable?,context-param*,filter*,filter-mapping*,listener*,servlet*,servlet-mapping*,session-config?,mime-mapping*,welcome-file-list?,error-page*,taglib*,resource-env-ref*,resource-ref*,security-constraint*,login-config?,security-role*,env-entry*,ejb-ref*,ejb-local-ref*)

用的是maven创建的的javaweb项目,其web.xml版本默认是Servlet2.3模板。
二、解决办法:更换web.xml版本

操作之前将web.xml文件中的配置复制粘贴出来

 

 

 

 

 Apply-OK后可以看到项目中的web.xml文件没了

重新添加web.xml文件:

 

 

 

 将操作之前粘贴出来的配置,放进新的web.xml文件中即可,不再报错

 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM