title: I keep getting this error, XML Parsing error: syntax error but still the website runs fine
body: <p>I am new to developing websites.
  I know that I have to map servlets in the web.xml file.
  The web.xml file is this</p>
  
  <pre><code>    &lt;?xml version="1.0" encoding="UTF-8"?&gt;
      &lt;web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd" version="3.0"&gt;
      &lt;display-name&gt;TestApp&lt;/display-name&gt;
      &lt;welcome-file-list&gt;
       &lt;welcome-file&gt;index.html&lt;/welcome-file&gt;
       &lt;welcome-file&gt;index.htm&lt;/welcome-file&gt;
       &lt;welcome-file&gt;index.jsp&lt;/welcome-file&gt;
       &lt;welcome-file&gt;default.html&lt;/welcome-file&gt;
       &lt;welcome-file&gt;default.htm&lt;/welcome-file&gt;
       &lt;welcome-file&gt;default.jsp&lt;/welcome-file&gt;
      &lt;/welcome-file-list&gt;
      &lt;servlet&gt;
       &lt;servlet-name&gt;Serve&lt;/servlet-name&gt;
       &lt;servlet-class&gt;Serve&lt;/servlet-class&gt;
      &lt;/servlet&gt;
      &lt;servlet-mapping&gt;
       &lt;servlet-name&gt;Serve&lt;/servlet-name&gt;
       &lt;url-pattern&gt;/TestApp&lt;/url-pattern&gt;
      &lt;/servlet-mapping&gt;
     &lt;/web-app&gt;
  </code></pre>
  
  <p>But when I call the jquery $.ajax() function, I get this error.</p>
  
  <blockquote>
    <p>XML Parsing Error: syntax error
    Location: <a href="http://localhost:8080/TestApp/Serve" rel="noreferrer">http://localhost:8080/TestApp/Serve</a>
    Line Number 1, Column 1:</p>
  </blockquote>
  
  <p>The AJAX Call is</p>
  
  <pre><code>    $.ajax({
      url: "Serve",
      type: "POST",
      success: function(out){
          alert(out);
      },
      error: function(){
          alert("No");
      }
  });
  </code></pre>
  
  <p>The problem is the servlet still runs fine. The alert(out) works as expected. Please explain why the browser is showing the error and please tell me a solution.</p>
  
  <p>If this is a duplicate question please give a link to the original question.</p>