The web.xml file reports an error: cvc-id.3: A field of identity constraint 'web-common-servlet-name-uniqueness' matched

How to open the web.xml in the project

insert image description here

Since some projects do not have web.xml after creation, they must be manually clicked to display

  1. First right click on the project and select Java EE Toks
  2. Next, select d and click on the second Generate Deployment Descriptor Stub
  3. Finally, reopening WEB-INF will refresh the web.xml.

insert image description here

web.xml file error problem

When configuring the web.xml in the project, I encountered the following error, roughly translated as follows: "The identity constraint "web-common-servlet-name-uniqueness" field matches the element "web-app", but the element does not have Simple type."
insert image description here

Solution

Change the java in the above xmlns="http://java.sun.com/xml/ns/javaee " to uppercase , as follows: xmlns=" http://java.sun.com/xml/ns/javaee " , the error message of the web.xml file is gone, and it can run normally! Screenshot below:
insert image description here

Guess you like

Origin blog.csdn.net/ex_6450/article/details/127550196