Hi,
I'm generating page content like:
// index.jsp
<%
List<Horse> horses = database.getHorses();
for (Horse it : horses) {
%>
<div><%= it.getName() %></div>
<%
}
%>
is it possible to grab the entire page content at the end of the jsp file, and dump it into a String, like:
String page = this.getPrintWriter().toString();
I'm just curious if this is possible. I might try caching the page as a String, but would need to rewrite my page generation to build everything in one StringBuilder like:
StringBuilder sb = new StringBuilder();
sb.append("<div>"); sb.append(it.getName()); sb.append("</div>");
...
<%= sb.toString() %>
String cached = sb.toString();
Thanks