title: Using model map in Velocity
body: <p>I'm using Spring MVC with velocity.</p>
  
  <p>I'm curious about how to post map key-value from controller to another site.</p>
  
  <pre><code>@RequestMapping(value = "/test/postMap.*", method = RequestMethod.GET)
  public String postMap(HttpServletRequest request, HttpServletResponse response,
            Model model) throws Exception {
  
    model.addAttribute(receiver, "solikang.com"); // not in real, just for example
    model.addAttribute(id, "solikang");
    model.addAttribute(pwd, "1234");
    return "postThis";
  }
  </code></pre>
  
  <p><strong>postThis.vm</strong></p>
  
  <pre><code>&lt;form id="oneItem" method="post" action=${receiver} &gt;
    &lt;input type="hidden" name="id" value="$!{id}" /&gt;
    &lt;input type="hidden" name="pwd" value="$!{pwd}" /&gt;
  
  &lt;/form&gt;
  &lt;script type="text/javascript" language="JavaScript"&gt;
      document.getElementById("oneItem").submit();
  &lt;/script&gt;
  </code></pre>
  
  <p>In 'postThis.vm', I fixed property name like 'id' and 'pwd'.</p>
  
  <p>This works, but if there are another parameters like 'name', 'email'. I have to modify postThis.vm to handle those parameters.</p>
  
  <p>I think, using model map and for loop, no need to modify.</p>
  
  <p>So, I want to know how to read model as map in velocity.</p>
  
  <p>If you have any idea or experience, please let me know.</p>
  
  <p>Thanks in advance.</p>