I have a jsp page that has code that looks like the following
for(int i = 0; i < count; i++)
{
%>
<jsp:include page="somepage.jsp"/>
<%
}
(in reality somejsp.jsp is dynamic so each iteration in the loop actually invokes a different jsp).
It takes about 2 seconds each for "somepage.jsp" to render and if the count is 5 then it takes about 10 secs for the page to render.
What i would like to do is to spawn a thread for each iteration. Each thread then invokes the jsp and after all the threads are done, the main thread can then get the output of each of the threads and output them.
The idea here is to see if i can make parallel the rendering of the each of jsp's and then collate them in the end to create the page.
Any help would be appreciated.
thx,
-anish