A solution that was written before we used Struts, but it works for us.

We have a process that generates some figures for bank loans.  It takes
interest rate and loan amount, and works out repayments etc, taking into
account lots of other variables.  This process can take minutes to complete.
In order to speed up our web site, rather than do this online for each
person applying for a loan, we pre-generate a deals.xml file containing the
figures for various loan amounts and numbers of repayments.  This process
has been known to take up to six hours to complete.

What we've done is to have a bean implement Observable, and then have an
Observer bean that is notifed each time one of the calculations completes.
We have a web page that keeps refreshing itself, and that gets information
from the Observer and prints out progress to date each time.  We also have a
cancel link, that tells the Observable object to stop calculating.

Hope that's of interest...

Tim.

-----Original Message-----
From: Chris Birch [mailto:[EMAIL PROTECTED]]
Sent: 14 February 2002 15:56
To: Struts Users Mailing List
Subject: RE: Showing a result after a long running query


Jim,

These comments are really guesses about how to do this rather than
knowledge... None of it relies on Struts in particular.

You have three pages: Form, Working and Results.

On the form page, you submit the data to the Working page which will store
the query request somewhere (possibly in the session scope but preferably in
the DB) and return a page with an animated 'working' gif.  This page then
uses a <meta http-equiv="refresh"> to call the Results page.  The animated
gif of the Working page just keeps on animating until your long query /
process returns some output to the browser.  In IE 5.5 + Netscape 6 on NT,
when pressing the back button it ignores the Working page so you should be
fine.

HTH,
Chris.





-----Original Message-----
From: Jim Tyrrell [mailto:[EMAIL PROTECTED]]
Sent: 13 February 2002 19:25
To: '[EMAIL PROTECTED]'
Subject: Showing a result after a long running query


Hello all,

I have looked at the struts docs and all over the net and I have posted to
forums at java.sun.com.

I want to show a user a page that says I am working on your problem and then
when the processing is done I will send to them/display for them the output
of the long running database query/process whatever.

Note I do not want the working in progress page to be shown again if I hit
the back button of the browser. I should just get to the form that I
inputted my parameters into to get the process rolling.

Does struts support this?
Does anyone know how to do this with some other technology?

This seems like a common problem and there should be an easy solution or at
least you would think so.

Thank You
Jim Tyrrell


--
To unsubscribe, e-mail:
<mailto:[EMAIL PROTECTED]>
For additional commands, e-mail:
<mailto:[EMAIL PROTECTED]>


--
To unsubscribe, e-mail:
<mailto:[EMAIL PROTECTED]>
For additional commands, e-mail:
<mailto:[EMAIL PROTECTED]>


This e-mail and its attachments are for the use of the addressee only.
It may contain information that is legally privileged, confidential and 
exempt from  disclosure.  It is not a contract, and prices, data 
and other information are not warranted as to completeness or accuracy.  
Any comments or statements  made herein do not necessarily 
reflect those of PanCredit Systems Limited. If you are not the intended 
recipient you must not copy, distribute or disseminate this e-mail 
or attachments to anyone other than the addressee.  
If you receive this communication in error please advise us by telephone 
at once. 
PanCredit Systems Limited 
Tel:    +44 113 250 0260 
Fax:    +44 113 250 0621 


--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to