title: Scala, @ResponseBody, and Map
body: <p>I'm experimenting with Scala in a spring3 project, and I'm not getting what I expect when I return a map with @ResponseBody. I'm including a working example in java along with my attempt in scala</p>
  
  <pre><code>// This is Java
  @RequestMapping(value="/pbx.admin", method=RequestMethod.GET)
  public @ResponseBody Map&lt;String, Object&gt; getInfo2(HttpServletRequest request, Model model){
      Map&lt;String, Object&gt; map = new HashMap&lt;String, Object&gt;();
      map.put("pbx", "admin");
      map.put("method", "s");
      return map;
  }
  </code></pre>
  
  <p>The java returns json with the pbx &amp; method defined, which is what I'm expecting. </p>
  
  <pre><code>// This is Scala
  @RequestMapping(value= Array("/pbx.admin"), 
    method=Array(RequestMethod.GET))
  @ResponseBody
  def getInfo2() = {
    Map("pbx" -&gt; "admin", "method" -&gt; "s")
  }
  </code></pre>
  
  <p>The scala returns something different though:</p>
  
  <pre><code>{
      empty: false,
      traversableAgain: true
  }
  </code></pre>
  
  <p>What do I need to do in order to get my map keys / values?  </p>
  
  <p>And for extra credit, Is there a better 'scala way' to do this?  Thanks!</p>