click-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ricardo Lecheta" <>
Subject Re: Redirect/forward after longer background operation
Date Thu, 23 Oct 2008 00:52:40 GMT

You can reload the page after 2 seconds as you said.. and check if your
background/thread process have already done its job..
To do this you can use a Thread, and save this "id" or "token" to identify
that process.


If you prefer you can use a Quartz Job to run your task in background... The
job can insert some data in some table in the database to tell your Page
that this job have finished successfully. And after that, the Page checks
every 2 seconds, for this data in the table... you can use the same "id" in
the first scenario...

I like the second option...

but for example WebWork2/Struts2 has the ExecuteAndWaitInterceptor  that
implements the first option


On Wed, Oct 22, 2008 at 10:35 PM, <> wrote:

> Hi all,
> I'm working on a dialog/wizard style web page: a couple of forms to gather
> data from the user, then a longer process that calculates some MD5 sums and
> a final page showing the result of the operation.
> I'm wondering what the best way would be to indicate to the user that an
> operation is running in the background and also automatically showing the
> result, once complete.
> Ideally I would put an icon/progress bar on the page while the background
> process on the server calculates the MD5 sums (in my example) and would need
> to automatically redirect the page once that's done.
> I'd like to avoid extensive AJAX/JavaScript if possible. One idea I had was
> to show a page with a progress bar that takes the id of the background
> process as GET parameter and refreshes every 2 seconds. Based on the id I
> can determine the status of the background operation and send a final
> redirect once that's done. Seems a bit cumbersome, though...
> Any ideas/suggestions would be appreciated.
> Thanks,
> Rico.
> --
> "Feel free" - 10 GB Mailbox, 100 FreeSMS/Monat ...
> Jetzt GMX TopMail testen:

Ricardo Lecheta

View raw message