title: Receiving error: "200": "parsererror": SyntaxError: "Unexpected end of input" during jquery ajax call
body: <p>This is my code:</p>
  
  <pre><code>$.ajax({
          url: "MyServlet",
          dataType: "json",
          data: data,
          type: "post",
          cache: false
      }).done(function (data) {
          alert('hello');
      }).fail(function (XMLHttpRequest, textStatus, errorThrown) {
          alert('error: ' + XMLHttpRequest.status + ": " + XMLHttpRequest.responseText + ": " + textStatus + ": " + errorThrown);
      });
  </code></pre>
  
  <p>And I receive: "error: 200: parsererror: SyntaxError: Unexpected end of input"</p>
  
  <p>I can't figure out why.  Any help?</p>
  
  <p>My servlet is basically returning the following:</p>
  
  <pre><code>PrintWriter out = response.getWriter();
  JSONObject json = new JSONObject();
  json.put("test", "hello servlet");
  out.print(json);
  out.close();
  </code></pre>