Cannot change version of project facet Dynamic Web Module to 2.5 错误

Problem: After creating a new maven webapp project, Cannot change version of project facet Dynamic web module to 3.0 or 2.5 appears

Analysis: When using Maven to create a new Web project, the Artifact Id is maven-artchetype-webapp. Since this catalog is relatively old , the servlet used is still 2.3, and generally it is at least 2.5 now. Modify the Dynamic web module in Project Facets to 3.0 will appear Cannot change version of project facet Dynamic web module to 3.0, as shown in the figure:

Solution :

1. Change the Servlet to 3.0, open the web.xml of the project, and modify the version in the web-app to 3.0: that is, modify it to _3_0.xsd

<web-app version="3.0" xmlns="http://java.sun.com/xml/ns/javaee"
    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"
    version="3.0" xmlns="http://java.sun.com/xml/ns/javaee" >

 

2. Modify the settings of the project, find the project path, and then find org.eclipse.wst.common.project.facet.core.xml in the .settings directory

I use Tomcat 7, change it to version=3.0 here, and then open that page and find that it has been changed:

Supplement : If it is a maven project, right click on the project Maven-->update project

References for this article:

The project prompts Cannot change version of project facet Dynamic Web Module to 2.5 error https://blog.csdn.net/u011781521/article/details/72903455

Solve eclipse error Cannot change version of project facet Dynamic 2.5 - CSDN blog https://blog.csdn.net/qq745520386/article/details/78246836 

 

Guess you like

Origin blog.csdn.net/qq_28421553/article/details/81111628