Pass value to update jsp

Hi, I am doing some process in a servlet such as inserting and I want to display the number of records that have been inserted from time to time in JSP page. I found that it can be done using following code in JSP. <% for (int x=0; x<100; x++) { %> <b>X is now <%=Integer.toString(x)%></b><br> <% out.flush(); try { Thread.sleep(1000); } catch (Throwable t) {} } The problem now is that I want to pass the number value which is the number of records inserted to the JSP from servlet. But if I use the following code to pass data res.sendRedirect("https://"+host+"/webpost/crn/cncreate.jsp?insnum='"+strnum+"'"); with variable insnum being the number passed, I think after the value is passed the JSP will display the insert status one time only and not continue to update itself. I do not want to put all the insert coding into jsp page. Any ideas? Thanks.