tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Kristian Rink <>
Subject [OT?] Servlet, redirect and progress-monitoring?
Date Wed, 02 Aug 2006 11:30:31 GMT

Hi all,

being aware that this is not a question strictly tomcat-relevant,
lacking a really good mailing-list for discussions closer to the J2EE
background itself, I hope for some input by all the gurus out there.

I'm into a situation like this: A servlet gathers statistical
information across the data in our DMS, is supposed to make a PDF out of
them and send them back to the client who requested them (PDF is demanded).

Problem, however, is that sometimes these computations take quite some
time, leaving me with two situations: (a) The browser itself considers
the connection to be "timed out" as the servlet is stuck in doGet() for
a bunch of minutes. (b) The user itself considers the connection to be
"dead" and closes the browser window. Both situations are uncomfortable.

By now, my initial idea was something like that, utilizing two servlets:

- Servlet 1 processes the request and immediately redirects the client
to another servlet while finishing the calculations and creating the PDF

- Servlet 2 refreshes, say, each 2 seconds, checking whether the file in
question finally has been created and put in place to, then, send this
back to the browser.

This, however, doesn't work out as Servlet 1, even though sending the
Redirect, doesn't redirect until leaving doGet(). So, that's not the

My question, now: Is there any "usual" / "best-practise" way of doing
something like that, of presenting people with a "please-stand-by" page
while there is activity goin' on in background? Is there a way of
solving something like this without being in need of JavaScript/AJAX/DWR
or something the like?

Any hints, even just pointers to good documentation on that issue, are
very much appreciated.

Thanks and bye,

Kristian Rink * * jab:
icq: 48874445 *  fon: ++49 176 2447 2771
"Wenn einer allein träumt, ist es nur ein Traum. Wenn viele gemeinsam
träumen, ist das der Anfang einer neuen Wirklichkeit." (Hundertwasser)

To start a new topic, e-mail:
To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message