title: spring Model is not filling automatically with json data
body: <p>I have written some sort of code to send data from client to spring model. and want that json data should automatically fill the java class. but not able to do this.</p>
  
  <p>Jquery looks like this</p>
  
  <pre><code>$('#login-form').submit(function(event){
          var username = $('#id_username').val();  
          var password = $('#id_password').val();
          alert(username + password)
          var json = { "loginId" : username, "password" : password};
  
        $.ajax({  
          type: "POST",  
          url: $("#login-form").attr("action"),
          data: JSON.stringify(json),
          beforeSend: function(xhr){
              var mess = validateForm();
              if(mess.length != 0){
                  $('#error-mes').show();
                  $('#error-mes').html(mess);
                  event.preventDefault();
                  return false;
              }
  
              xhr.setRequestHeader("Accept", "application/json");  
              xhr.setRequestHeader("Content-Type", "application/json");
              return true;
          },
          success: function(response){
               $('#error-mes').html(response);
               $('#error-mes').show();
          },  
          error: function(e){  
            alert('Error: ' + e);  
          }  
        });  
        event.preventDefault();
        $('#userName').hide();
        $('#spn_password').hide();
  });
  </code></pre>
  
  <p>Spring code like this</p>
  
  <pre><code>@RequestMapping(value = "/signin", method = RequestMethod.POST )
      public @ResponseBody String submitCustSignInForm(HttpServletRequest request, @ModelAttribute("model") Person model,
              HttpSession sess) {
  
          String response = "";
          Person person = null;
  
          if (sess.getAttribute("USER_INFO") == null) {
              person = tsService.login(model);
              if (person == null) {
                  response = "User name or password does not match.";
              } else {
                  response = "success";
                  sess.setAttribute("USER_INFO", person);
              }
          }
          return response;
      }
  </code></pre>
  
  <p>Person model has same loginId and password attribute and setter and getter in class.</p>
  
  <p>can some body tell me how can it achieved.</p>