• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Pass value to update jsp

 
Ranch Hand
Posts: 204
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Whoever got anywhere by being normal? Just ask this exceptional tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic