title: No servlet response via Ajax
body: <p>I've written a simple servlet for processing an Ajax request. On the server side, the <code>doPost</code> is called, but the data that I've set in the response object is not reflected on the client. (Actually, I'm not getting anything on the client according to Firebug). I'm using jQuery to handle the Ajax.</p>
  
  <p>Client code:</p>
  
  <pre><code>$.post(
     '/mapped/url?param=' + $('#eleId').val(),
        function(data){
          alert(data);
        },
        "xml"
  );
  </code></pre>
  
  <p>On the server:</p>
  
  <pre><code>protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
      System.out.println("!!!In post!!!!");
      // some calculations go here
  
      response.setContentType("application/xml");
      response.setHeader("Cache-Control", "no-cache");
  
      response.getWriter().write("&lt;data&gt;&lt;param number=\"\"&gt;&lt;/param&gt;&lt;/data&gt;");
              response.setStatus(HttpServletResponse.SC_OK);
  }
  </code></pre>
  
  <p>Thanks in advance!</p>