Java 如何在 Eclipse 中修复“无法将项目方面动态 Web 模块的版本更改为 2.4”?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/22037725/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-13 13:12:11  来源:igfitidea点击:

How to fix "Cannot change version of project facet Dynamic Web Module to 2.4" in Eclipse?

javaeclipsespring

提问by Paul Drummond

My WAR project was working fine but when I updated to latest version of STS (3.5.0.M2) I get the following error:

我的 WAR 项目运行良好,但是当我更新到最新版本的 STS (3.5.0.M2) 时,出现以下错误:

Cannot change version of project facet Dynamic Web Module to 2.4

无法将项目方面动态 Web 模块的版本更改为 2.4

回答by borino

try edit your WEB.XML file. Check on top of file

尝试编辑您的 WEB.XML 文件。检查文件顶部

**http://java.sun.com/xml/ns/j2ee/web-app_3_0.xsd" >**

回答by sumit sharma

open project folder and goto .settings and open org.eclipse.wst.common.project.facet.core.xml change version like this.

打开项目文件夹并转到 .settings 并打开 org.eclipse.wst.common.project.facet.core.xml 像这样更改版本。

回答by Amol Dixit

open project folder and goto .settings and open org.eclipse.wst.common.project.facet.core.xml change version to that matching with the one in web.xml

打开项目文件夹并转到 .settings 并打开 org.eclipse.wst.common.project.facet.core.xml 将版本更改为与 web.xml 中匹配的版本

then Maven -> Update Project

然后 Maven -> 更新项目

you will observe that the error is no more:)

您将观察到错误不再存在:)