title: Is it possible in Spring MVC 4 return Boolean as JSON?
body: <p>I have a simple method in Controller</p>
  
  <pre><code>@RequestMapping("admin")
  public @ResponseBody
  Boolean admin() {
      Boolean success = true;
      return success;
  }
  </code></pre>
  
  <p>and in respond i want return <code>{ "success": true }</code></p>
  
  <p>Annontation <code>@ResponseBody</code> says that the response will be JSON. But now in repsonse I recieve just true.</p>
  
  <p>Is there is any other way how to solve it?</p>
  
  <p>Or I should to do something like </p>
  
  <pre><code>@RequestMapping("admin")
  public @ResponseBody
  Map&lt;String, Boolean&gt; admin() {
      Map&lt;String, Boolean&gt; success = new TreeMap&lt;String, Boolean&gt;();
      success.put("success", true);
      return success;
  }
  </code></pre>
  
  <p>I would like to know best practise for this.</p>