velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Attila Szegedi" <>
Subject Re: velocity servlet buffer
Date Thu, 12 Sep 2002 14:36:32 GMT
Hm, this is an interesting approach however Dave might need to display
results progressively. I had such a situation in a past project: a webapp
front end was querying a massively distributed database, and it was a design
requirement that whenever a partial result came in from one of the servers,
it be formatted and pushed to the client's browser ASAP.

I solved that by sticking a special iterator in the context that wait()-ed
when there were no partial results (blocking the rendering machinery) until
another thread that received a partial result pushed it into a queue and
notify()ed. Template output was flushed on end of the foreach block. That
said, the template engine was not Velocity, but another one that happens to
have a flush directive, but you can no doubt roll your own flusher for
Velocity as well by writing some ammount of almost trivial glue code... With
Velocity it helps if you're a do-it-yourself enthusiast when it comes to any
feature outside of its minimalist philosophy :-)

Attila Szegedi

----- Original Message -----
From: "Sampath Kondam" <>
To: <>
Sent: 2002. szeptember 12. 16:01
Subject: Re: velocity servlet buffer

> Hi Dave,
> This can be done by providing by generating an intermediatery page with a
gif image informing the user saying that the request is under process. In
intermediatery page set the HTTP refresh header with a refresh rate and when
serving the request check with the process, if it is done render the page
with the resulting content otherwise render the refresh page again. The
processing object reference can be maintained in the user session.
> Let me know if you need more information
> --Sampath
> --
> To unsubscribe, e-mail:
> For additional commands, e-mail:

To unsubscribe, e-mail:   <>
For additional commands, e-mail: <>

View raw message