dcsimg
updating a field while page is already being displayed
2 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Carmi_Gazit
Posted On:   Thursday, July 24, 2003 09:33 AM

I have a process that takes a long time. I want to display a status (i.e. processed record 10 out of 5000 ) Once I'm finished, I want to forward the page to reload a new jsp. I was using code like this: <% String currentRecord ; for (int x=0; x <5; x++) { currentRecord = (String)request.getAttribute("currentRecord"); %> Currently processing <%=currentRecord%> out of <%=numRecords%> <% out.flush(); try { Thread.sleep(1000); } catch (Throwable t) {} } %> but because I use out.flush() ( which does the commit) I could not forward to another jsp.    More>>


I have a process that takes a long time. I want to display a status (i.e. processed record 10 out of 5000 )


Once I'm finished, I want to forward the page to reload a new jsp. I was using code like this:


<%
String currentRecord ;
for (int x=0; x <5; x++) {
currentRecord = (String)request.getAttribute("currentRecord");
%>
Currently processing <%=currentRecord%> out of <%=numRecords%>

<%
out.flush();
try { Thread.sleep(1000); } catch (Throwable t) {}
}
%>



but because I use out.flush() ( which does the commit) I could not forward to another jsp.



Thanks for any help

   <<Less

Re: updating a field while page is already being displayed

Posted By:   Maxim_Wirt  
Posted On:   Thursday, August 21, 2003 03:16 AM

send small JavaScript code to the page after the cycle


Re: updating a field while page is already being displayed

Posted By:   raj_kumar98_kansal  
Posted On:   Thursday, July 24, 2003 02:06 PM

hi Carmi
instead of forwarding you can redirect the page to another page.this you can do in a java script which will redirect to other page after some time or you can use


in head tag here content=1 tells that after 1 second the page gets forward to mail.yahoo.com.So you can set time as much you require.
About | Sitemap | Contact