title: Java hashmap value to be used as a javascript hashmap in jsp
body: <p>I have a hashmap stored in request</p>
  
  <pre><code>request.setAttribute("occupationMap", occupationMap);
  </code></pre>
  
  <p>I need to store the same map in javascript hashmap on a JSP. So I can fetch the key values in multi-tier dropdown based on the conditions. </p>
  
  <pre><code>var occupationMap = '&lt;%=request.getAttribute("occupationMap")%&gt;';
  alert(occupationMap);
  </code></pre>
  
  <p>Can anyone suggest how do I convert occupationMap into a javascript map on JSP.
  Thanks.</p>