问题
Getting the error below from Eclipse. What does it mean "must be well-formed"? Is there a mistake in the xml?
The markup in the document following the root element must be well-formed
web.xml
<?xml version="1.0" encoding="UTF-8"?>
<display-name>...</display-name>
<servlet>
<servlet-name>action</servlet-name>
<servlet-class>...</servlet-class>
<init-param>
<param-name>config</param-name>
<param-value>/WEB-INF/struts-config.xml</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>action</servlet-name>
<url-pattern>*.do</url-pattern>
</servlet-mapping>
</web-app>
回答1:
Basically, what a well-formedness error occurs when your tags are not properly nested/not properly closed. It appears to be the most likely case for you since you already have content in your xml. The characters < > & need to be escaped in XML text.
Upload your file to - http://www.cogsci.ed.ac.uk/~richard/xml-check.html to see the well-formedness errors.
Change your XML to:
<?xml version="1.0" encoding="UTF-8"?>
<web-app>
<display-name>...</display-name>
<servlet>
<servlet-name>action</servlet-name>
<servlet-class>...</servlet-class>
<init-param>
<param-name>config</param-name>
<param-value>/WEB-INF/struts-config.xml</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>action</servlet-name>
<url-pattern>*.do</url-pattern>
</servlet-mapping>
</web-app>
来源:https://stackoverflow.com/questions/13433534/xml-must-be-well-formed-issued-for-web-xml-file-of-a-jsp-servlet-project