title: How to get key-value pairs from servlet in java script using ajax?
body: <p>In my servlet I am creating a list key-value pairs with the help of a Map  </p>
  
  <pre><code>Map map=new HashMap();  
  map.put("1", "john");  
  map.put("2", "cris");  
  map.put("3","patrik");  
  JSONObject jsonMap=new JSONObject(map);  
  
  out.print(jsonMap);  
  </code></pre>
  
  <p>I am calling the above servlet through ajax. 
  I want to know how can I print all the key-value pairs in my javascript(<strong>with and without using jquery</strong>) without knowing the key values?  </p>
  
  <p>Any other idea how can I get both key-value pairs from servlet in javascript using ajax ?  </p>
  
  <p>Thanks</p>