Skip to Main Content

Java Programming

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Multithreading within a JSP

807607Nov 22 2006 — edited Nov 22 2006
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
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Dec 20 2006
Added on Nov 22 2006
7 comments
1,029 views