解决Cannot change version of project facet Dynamic Web M

dynamic web module 版本之间的区别:

Servlet 3.0 December 2009 JavaEE 6, JavaSE 6 Pluggability, Ease of development, Async Servlet, Security, File Uploading
Servlet 2.5 September 2005 JavaEE 5, JavaSE 5 Requires JavaSE 5, supports annotations
Servlet 2.4 November 2003 J2EE 1.4, J2SE 1.3 web.xml


错误Cannot change version of project facet Dynamic Web Module to 3.0:
在项目右键属性的Project facts中把Dynamci Web Module设置为3.0,如果报错则直接修改项目文件:工程.settings目录下的org.eclipse.wst.common.project.facet.core.xml,同时把web.xml开头设置为:

    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd">
然后执行项目右键Maven的Update Project...即可。

posted @ 2015-12-11 14:36  Hotsum  阅读(194)  评论(0编辑  收藏  举报