title: access Map through jquery inside spring model
body: <p>How can I get the value of a Map key in spring mvc view page, with map passed to Model as below in controller:</p>
  
  <pre><code> ModelAndView modelAndView = new ModelAndView("addEvent");
   modelAndView.addObject("saveList", saveList);
   modelAndView.addObject("saveIDMap", saveIDMap);
  
   return modelAndView;
  </code></pre>
  
  <p>where saveIDMap is a <code>Map&lt;String, Integer&gt;</code></p>
  
  <p>The jquery code trying to access it in jsp page is:</p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
     $(document).ready(function(){
       $("#saveTypeID").on('change', function() {
         var val = $("#saveTypeID").val();       ----getting here successfully
         var saveId = "${saveIDMap['" + val + "']}";  ---trying to get hashmap value
         $("#saveIDID").val(saveID);
      });
     });
  &lt;/script&gt;
  </code></pre>
  
  <p>where the ids are in the form snippet below:
        <br>
         <br>
            </p>
  
  <pre><code>      &lt;tr&gt;  
        &lt;td&gt;SaveType :&lt;/td&gt;  
        &lt;td&gt;&lt;form:select path="saveType" items="${saveList}" id ="saveTypeID"/&gt;&lt;/td&gt;  
       &lt;/tr&gt;  
  
       &lt;tr&gt;
       &lt;td&gt;SaveId :&lt;/td&gt;  
        &lt;td&gt;&lt;form:input path="saveId" id="saveIDID"/&gt;&lt;/td&gt;  
       &lt;/tr&gt;  
  </code></pre>
  
  <p>The JQuery code after the part to access saveIDMap is not running, and where do I see error messages for jquery in a tomcat container?</p>
  
  <p>Please help! New to jquery.</p>
  
  <p>Thanks</p>