-----------------------------
Please read the FAQ!
<http://java.apache.org/faq/>
-----------------------------
On Tue, Aug 24, 1999 at 11:14:56AM +0100, Andy Jefferson wrote:
> -----------------------------
> Please read the FAQ!
> <http://java.apache.org/faq/>
> -----------------------------
>
> Hi,
>
> not sure of the best place to ask this one. Anyway, I've got a servlet
> (running on Apache, with JServ 1.0 for what it matters) doing DB
> accesses, and some of these accesses take a while to complete. I want to
> give the user feedback while the DB query is being performed - something
> along the lines of
>
> 'Awaiting query results. Please wait ...'
I've never done this myself, but it should work. You can do it in two
requests to the servlet. The first does nothing except ouput a page with
your "Please wait..." message, along with a Refresh header, like so:
res.setHeader("Refresh", "0;URL=http://your_servlet?db=yes");
(You may need to set the header before writing the document). This
displays the "please wait" page and then makes the browser immediately
send another request to the servlet with some extra parameter to
indicate that this is the "real" request. The servlet now performs the
DB access before writing anything to the client.
Due to the way browsers handle this, the "please wait" page is remains
until the the DB work finishes and the final page is produced by the
servlet.
One problem is that I don't think this can work with POSTs.
--
Lachlan O'Dea <mailto:[EMAIL PROTECTED]> Computer Associates Pty Ltd
Webmaster Vet - Anti-Virus Software
http://www.vet.com.au/
"If you only knew the power of the dark side." - Darth Vader
--
--------------------------------------------------------------
Please read the FAQ! <http://java.apache.org/faq/>
To subscribe: [EMAIL PROTECTED]
To unsubscribe: [EMAIL PROTECTED]
Archives and Other: <http://java.apache.org/main/mail.html>
Problems?: [EMAIL PROTECTED]