When using eclipse to create Maven archetype webapp, the project of web app version 2.3 is automatically created. When modifying the dynamic web module to 2.5 through project faces, the error will be reported: cannot change version of project facet dynamic web module to 2.5
Solution steps:
1. Right click Project – > Show In -> Navigator
2. In the. Settings directory, double-click to open the org.eclipse.wst.common.project.facet.core.xml file, change the version of install facet = “JST. Web” from 2.3 to 2.5, and save it
3. Open the web.xml file and replace its contents
Automatically generated content
<!DOCTYPE web-app PUBLIC
"-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
"http://java.sun.com/dtd/web-app_2_3.dtd" >
<web-app>
<display-name>Archetype Created Web Application</display-name>
</web-app>
Replace with the following
<?xml version="1.0" encoding="UTF-8"?>
<web-app version="2.5" 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_2_5.xsd">
<display-name>Archetype Created Web Application</display-name>
</web-app>
preservation
4. Right click the item – > Maven -> Update Project… -> OK
So far, the project has been successfully modified to web 2.5
Verification: check the project faces, and the dynamic web module changes to 2.5
Similar Posts:
- How eclipse modifies dynamic web module version
- How to Solve Maven Project Error: Cannot change version of project facet Dynamic web module to 3.0/3.1
- Configure Struts2 web.xml to report an error [How to Solve]
- maven web web.xmlThe markup in the document following the root element must be well-formed.
- The server does not support version 3.1 of the JEE Web module specification.
- The solution of “unsupported major. Minor version 52” in Java project compilation
- The requested resource [/servlet] in JavaWeb is not available [How to Solve]
- Java web about web.xml 3.1
- How to Solve Error: The content of element type “web-app” must match “(icon?display
- [java development series] – Tomcat compilation error