title: How to send JSON array from server to client, i.e. (java to AJAX/Javascript)?
body: <p>I have the following JSON array in my JSON.java file:</p>
  
  <pre><code>ArrayList array=new ArrayList();
  array.add("D");
  array.add("A");
  array.add("L");
  </code></pre>
  
  <p>I would like to send array to the AJAX script located in AJAX.jsp.
  I know how to receive the text in AJAX via e.g.</p>
  
  <pre><code>document.getElementById("txtHint").innerHTML=xmlhttp.responseText;
  </code></pre>
  
  <p>But I don't know how to send the array from the server to the client!
  Appreciate your help</p>