title: How to pass list containing hash map from jsp to controller on page submit in spring mvc
body: <p>The list size in controller is getting 0.
  The JS file is simply submitting the form, jsp file is iterating the list of hashMap which is getting populated on page load, and third one is the controller receiving the list after the submit button has been clicked in jsp page.</p>
  
  <pre><code>JS file:
  
  function getFormDetails(){
   document.forms[0].action=requestPath+"/admin/updateInterfaceParams.do";
   document.forms[0].submit();
  }
  
  JSP file:
  &lt;form:form method="post" cssStyle="float:left;"&gt;
  &lt;c:forEach var="list" items="${manageInterfaceList }" varStatus="stat"&gt;
     &lt;c:forEach var="entry" items="${list}"&gt;
      &lt;c:if test="${entry.key eq 'A'}"&gt;
      &lt;input type="hidden" name="interfaceList[${stat.index}].key"
                          value="${entry.key}" /&gt;
      &lt;span&gt;Key:&lt;/span&gt;
      &lt;input type="text" id="keyAjax" name="interfaceList[${stat.index}].value" 
        value="${entry.value}"/&gt;
      &lt;/c:if&gt;
      &lt;br /&gt;
      &lt;c:if test="${entry.key eq 'B'}"&gt;
      &lt;input type="hidden" name="interfaceList[${stat.index}].key"
        value="${entry.key}" /&gt;
      &lt;span&gt;Password:&lt;/span&gt;
      &lt;input type="text" id="password"
      name="interfaceList[${stat.index}].value" value="${entry.value }"/&gt;
      &lt;br /&gt;
      &lt;/c:if&gt;
      &lt;/c:forEach&gt;
      &lt;/c:forEach&gt; 
      &lt;span&gt;&lt;input type="button"
              name="Submit" value="Submit" onclick="getFormDetails();"/&gt;&lt;/span&gt;
      &lt;/form:form&gt;
      Controller:
  
  @RequestMapping(value = "/updateInterfaceParams.do")
              public ModelAndView updateInterfaceParams(HttpServletRequest request,
  @ModelAttribute ArrayList&lt;HashMap&lt;String,String&gt;&gt; manageInterfaceList) {
  
                  ModelMap modelMap = new ModelMap();
                  try {
                      System.out.println(manageInterfaceList.size());
                  } catch (Exception e) {
  
                      modelMap.addAttribute("errorMessage",e.getMessage());
                  } 
                  return new ModelAndView("manageinterface", modelMap);
              }
  </code></pre>
  
  <p>Any suggestions regarding why the list size is coming as 0 and how to get list elements in controller.</p>