title: Return spring mvc Model on Ajax response
body: <p>I am having a controller that return model objects like below
  model.addAttribute("list", list);</p>
  
  <p>When i click a button ajax call happens and it is goes to controller executing everything and it returns. But i don't know how to access this model object in my jsp on ajax response. When i use alert for success ajax response , I am just seeing a html kind of page.</p>
  
  <p>Please give me some example or reference to achieve this</p>
  
  <p>Thanks in advance</p>
  
  <p>Please find my sample code snippet</p>
  
  <h2>Controller.java</h2>
  
  <pre><code>@RequestMapping(value='/ajax' value="POST")   
   Public @ResponseBody String displayDropdown(MyForm myform,Model model) {  
   //logic to fetch details from DB 
   List&lt;String&gt; list = fetchFromDB(); 
   model.addAttribute("list" list);  
   return "ajaxResponse";  
  }
  </code></pre>
  
  <h2>My JSP</h2>
  
  <p>In a button click, having the below ajax call</p>
  
  <pre><code>$.ajax {  
     url:'/ajax',  
     type:'POST',   
     data: $("#myform").serialize();   
     success:function(data) {   
     alert(response);      
     }    
  }
  </code></pre>
  
  <p>I want to get my model from this ajax response and use it in my jsp.</p>