title: @RequestBody not binding complex object
body: <p>I am trying to pass <code>json</code> object form <code>javascript</code> to Spring controller using <code>jquery ajax</code>. But if <code>json</code> object is complex it is not binding.</p>
  
  <p><strong>Javascript:</strong></p>
  
  <pre><code>    var inputParam={};
      inputParam.name="xxx";
      inputParam.address.city="chicago";
      inputParam.address.zip="123456";
  
      var jqxhr = $.ajax({
              url:"/myurl",
              type:"POST",
              dataType: "html",
              contentType :'application/json',
              data:JSON.stringify(inputparam),
              beforeSend: function( xhr ) {
  
  
              }
          });
  
  //Handle a successful call to data service
      jqxhr.done(function(  data, textStatus, jqxhr,response ) {
          // my successful code handle
  
      });
  
      //Handle an unsuccessful call to data service
      jqxhr.fail(function(jqXHR, textStatus) {    
  
          //my error handling code
  
      });
  </code></pre>
  
  <p><strong>Controller:</strong></p>
  
  <pre><code> @RequestMapping(value = "/myurl", method = RequestMethod.POST)
   public String getMyPage(  @RequestBody InputParams inputParam,HttpServletRequest request, Model model ) throws Exception{
          //my code
    }
  </code></pre>
  
  <p><strong>POJO:</strong></p>
  
  <pre><code>class InputParams {
     private String name;
     private Address address;
    //getter setter
  }
  
  class Address{
    private String city;
    private String zip;
    //getter setter
  }
  </code></pre>
  
  <p>The problem i am having is address is not binding on controller.</p>
  
  <p>Any idea what am i doing wrong here ?</p>