I'm just diving into Spring MVC, and am trying to render a view from a String containing JSP as opposed to a JSP File.
For example:
public ModelAndView execute() {
String contentToRender = "
<p>Counting to three:</p>
<% for (int i=1; i<4; i++) { %>
<p>This number is <%= i %>.</p>
<% } %>
<p>OK.</p>
";
ModelAndView view = new ModelAndView (contentToRender);
return view;
}
Which doesn't work.
How can I render this to the page from a controller?