title: Passing multiple variables in @RequestBody to a Spring MVC controller using Ajax
body: <p>Is it necessary to wrap in a backing object? I want to do this:</p>
  
  <pre><code>@RequestMapping(value = "/Test", method = RequestMethod.POST)
  @ResponseBody
  public boolean getTest(@RequestBody String str1, @RequestBody String str2) {}
  </code></pre>
  
  <p>And use a JSON like this:</p>
  
  <pre><code>{
      "str1": "test one",
      "str2": "two test"
  }
  </code></pre>
  
  <p>But instead I have to use: </p>
  
  <pre><code>@RequestMapping(value = "/Test", method = RequestMethod.POST)
  @ResponseBody
  public boolean getTest(@RequestBody Holder holder) {}
  </code></pre>
  
  <p>And then use this JSON:</p>
  
  <pre><code>{
      "holder": {
          "str1": "test one",
          "str2": "two test"
      }
  }
  </code></pre>
  
  <p>Is that correct? My other option would be to change the <code>RequestMethod</code> to <code>GET</code> and use <code>@RequestParam</code> in query string or use <code>@PathVariable</code> with either <code>RequestMethod</code>. </p>