We had the same problem and first tried sending a multipart response with a
"please wait" until the calculation was finished. We had a few problems with
browsers viewing multipart responses and did not have the time to investigate.
Instead, we got the original "calculating" servlet to redirect to a "display"
servlet, which redirected to itself every minute:
response.setHeader("Refresh", "60; URL=displayServlet");
The "display" servlet also checks the session everytime it is reloaded, as the
"calculating" servlet puts the result into the session when it has finished.
When the "display" servlet finds the result in the session, it displays it and
stops reloading.
hope that helps
brian
Bruno Lowagie wrote:
> I have a servlet that starts a long series of calculations.
> The calculations can take up to 30 minutes.
>
> This leads to 2 problems:
> 1. The timeout of the server is less than 30 minutes,
> so we get a 'document contains no data'.
> 2. We don't want to raise the timeout, because a user
> won't usually wait that long.
>
> We thought of the following solution:
> 1. The user calls a servlet.
> 2. This servlets starts a process in background that calculates
> a result and writes it to a file on the server.
> 3. The user gets an immediate response with the URL of this file,
> so he can visit this URL once the calculations are finished.
>
> What is the best way to do this? A servlet calling another servlet?
> Starting a thread (but won't this thread be killed once the servlet
> has sent his response)?
>
> Is there a means to let the user know when the calculations are done
> to prevent 404 errors or having to look at an incomplete result?
>
> Thanks in advance,
> Bruno
>
> ___________________________________________________________________________
> To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
> of the message "signoff SERVLET-INTEREST".
>
> Archives: http://archives.java.sun.com/archives/servlet-interest.html
> Resources: http://java.sun.com/products/servlet/external-resources.html
> LISTSERV Help: http://www.lsoft.com/manuals/user/user.html
___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".
Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html