title: convert java map to javascript map and loop over to get keys/values?
body: <p>In java i have hashmap</p>
  
  <pre><code>Map&lt;String , List&lt;Employee&gt;&gt; employeeMap = new HashMap&lt;String , List&lt;Employee&gt;&gt; ();
  employeeMap.put(1, new Employee());
  ........
  </code></pre>
  
  <p>I am adding it in request attribute</p>
  
  <p>Now in javascript i need to loop over over map, to get keys and values</p>
  
  <p>Here what i tried</p>
  
  <p><strong>Approach 1 :-</strong></p>
  
  <pre><code>var empMap = '${employeeMap}'; 
  //here is the example value of map in javascript which i see while debugging
  //var empMap = {emp1_100=[com.Employee@5b7b4bc5], emp2...
  
  for (var key in empMap) {
      alert(key + ': ' + empMap[key]);
  }
  </code></pre>
  
  <p>But getting syntax error</p>
  
  <pre><code> SyntaxError: missing : after property id
  </code></pre>
  
  <p><strong>Approach 2 :-</strong> with jquery</p>
  
  <pre><code> var jsonMap  = $.stringify(empMap);
  
   $.each( jsonMap, function( key, value ) {
    alert( key + ": " + value );
  });
  </code></pre>
  
  <p>But its not working either. It print some characters. </p>
  
  <p>I am not sure what i am missing here ?</p>