title: Spring MVC - Cannot map request parameters as a Map parameter in method?
body: <p>What I want to do is passing a map to the method in Controller using @RequestParam, but it seems not working.  While this is working in Struts 2 as value binding.</p>
  
  <p>Below is what I am trying:
  In JSP using JQuery:</p>
  
  <pre><code>var order = {};
  order['seq'] = "ASC";
  var criteria = {};
  criteria['label'] = "Directory";
  
  $.post(context + 'menu/list',
      {"orders" : order,
       "criterias" : criteria}
  </code></pre>
  
  <p>The parameters I am trying to post is an 'map' object order and criteria for listing menu.
  In Java:</p>
  
  <pre><code>    @RequestMapping("/{collection}/list")
  public @ResponseBody Map&lt;String, ? extends Object&gt; list(@PathVariable String collection,
          @RequestParam("criterias") Map&lt;String, String&gt; criteria,
          @RequestParam("orders") Map&lt;String, String&gt; order) {
  </code></pre>
  
  <p>However, when I print out the map criteria &amp; order in Java, it takes all value as below:</p>
  
  <pre><code>Criteria: {criterias[label]=Directory, orders[seq]=ASC}
  Order: {criterias[label]=Directory, orders[seq]=ASC}
  </code></pre>
  
  <p>Can @RequestParam in Spring be used to init a Map parameter?</p>