Chrisitan Noack wrote:
> In our application the processing of the data after a submit takes some
> time. We'd like the client (browser) to be informed, that he/she has to
> wait some time. When the processing is finished, we want the next page to
> be shown. What is the best way achieve this with tapestry?

This is seemingly easy to do and very hard to do right. :)

Whatever action you want to process should be started on a separate thread
(you need to think about deadlocks, concurrency issues with your
application/session handling/database here), with the possibility to
announce completion back to the controlling class. After starting the
background action, show the 'Please wait..' page. The following HTML will
trigger automagic reloading of a page: <head><meta http-equiv="refresh"
content="0; URL=my.url.here"></head>
Obviously you need to trigger an action method to check whether the
background thread has already finished or not; if it has, just resume
normal processing, else just show the Wait page again.
All this is moderately easy to do in a first cut, but very hard to do
right if you cleanly want to separate model, view & controller in a
reusable fashion, thread-safe and deadlock-free in a multi-user scenario,
without busy-waiting or too much resource contention.

I have such a set of classes for WebObjects and can show you how it works
on Friday. A translation to Tapestry (at least design-wise) should be
doable, although I strongly recommend to resolve the need for this instead
- make your (DB?) operations faster, if at all possible.

Btw: Doug Schmidts' POSA2 book (cf.
http://www.cs.wustl.edu/~schmidt/POSA/) is a nice read for anybody
interested in modeling asynchronous, decoupled and/or message-passing
systems.

Holger


-------------------------------------------------------
Sponsored by:
ThinkGeek at http://www.ThinkGeek.com/
_______________________________________________
Tapestry-developer mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/tapestry-developer

Reply via email to