title: spring mvc response not loading in jquery ajax call
body: <p>I have the following jQuery ajax code:</p>
  
  <pre><code>&lt;script&gt;
  
      $(function() {
          $("button").click(function() {
              $.ajax({
                  url : "signin.html",
                  type : "post",
                  cache: false,
                  data : "userName=" +$("#userName").val()+ '&amp;password='+$("#password").val(),
                  success : function(data) {
                      var obj = jQuery.parseJSON(data);
                      var msg = '&lt;span&gt;' + obj.message + '&lt;/span&gt;';
                      $('#message').html(msg);
                  },
               //EDIT
      error: function(){                      
          alert('Error in response...');
      }
              });
          });
      });
  &lt;/script&gt;
  
  
  &lt;div id="message"&gt;&lt;/div&gt;
  </code></pre>
  
  <p>I have spring controller which sends message as responses which I am trying to print in the message box. I see the request processed by the controller but the message from the controller is not getting displayed in the page. What am I doing wrong here?</p>
  
  <pre><code>public @ResponseBody ModelAndView loginUser(request attributes here){
  
              isUserExisits = service.authenticateUser(userBO);
              if (isUserExisits) {
                  model.addObject("message", "Login Success");
              } else {
                  model.addObject("message", "Login Failed");
              }}
  </code></pre>
  
  <p>EDIT:- I have added error callback after 'success' and error call back function is getting called. </p>