title: Spring MVC - AJAX-JSON Response to contain rendered JSP view
body: <p>I need my controller to return an AJAX JSON response that contains the updated HTML code.</p>
  
  <p>The updated HTML code is created by rendering a JSP view.</p>
  
  <p>For example:
  JSP:</p>
  
  <pre><code>&lt;tr&gt;
  &lt;td&gt;${data1}&lt;/td&gt;
  &lt;td&gt;${data2}&lt;/td&gt;
  &lt;/tr&gt;
  </code></pre>
  
  <p>JSON response:</p>
  
  <pre><code>{"columns" : "2", "rows":"1", "data":rendered view}
  </code></pre>
  
  <p>Currently I'm trying to create a dummy response with "my own" outputstream and put the rendered view content in the json response, but with no luck.</p>
  
  <p>Other than the fact I can't get this solution to work, it doesn't feel right.
  Any tips on the proper way to do it?</p>
  
  <p>Thanks,
  Ori</p>