Configure Struts2 web.xml to report an error [How to Solve]

When configuring my first struts 2, I created a new web project in MyEclipse 8.6, and then the web.xml under Webroot/WEB-INF is automatically generated. The XML header file information is:

<?xml version="1.0" encoding="UTF-8"?>
<web-app version="2.5" 

When I filled in the code for configuring Struts2, I reported an error:

1. Struts 2 Code:

<display-name>My First struts2 Programmer</display-name> 


2. Error:

Multiple annotations found at this line:
    - cvc-complex-type.2.3: Element 'web-app' cannot have character [children], because the type's content 
     type is element-only.

Later, it was found that there was no problem with the Struts2 configuration code, but with the third line in the XML header file:

xmlns=” ”

Maybe it’s the habit of using J2EE all the time? It’ll be fine after it’s changed to J2EE anyway

Similar Posts: