head	1.6;
access;
symbols;
locks
	nobody:1.6; strict;
comment	@# @;


1.6
date	99.08.24.19.23.40;	author nobody;	state Exp;
branches;
next	1.5;

1.5
date	99.08.24.19.22.58;	author nobody;	state Exp;
branches;
next	1.4;

1.4
date	99.08.24.19.22.16;	author nobody;	state Exp;
branches;
next	1.3;

1.3
date	99.08.23.17.23.56;	author nobody;	state Exp;
branches;
next	1.2;

1.2
date	99.08.23.17.22.48;	author nobody;	state Exp;
branches;
next	1.1;

1.1
date	99.08.23.17.22.17;	author nobody;	state Exp;
branches;
next	;


desc
@null
@


1.6
log
@null
@
text
@IDependOn-Set: 1
IDependOn-Set: 119
IDependOn-Set: 2
IDependOn-Set: 283
IDependOn-Set: 291
IDependOn-Set: 292
LastModifiedSecs: 935522619
Parent: 119
SequenceNumber: 3
Title: How to create a "Please wait..." page...using server push...
Part: 0
Author-Set: jon@@working-dogs.com
HideAttributions: 1
LastModifiedSecs: 935522619
Type: monospaced
Lines: 91
----------
From: Wilfried Geis <willi@@itm-research.de>
To: Java Apache Users <java-apache-users@@list.working-dogs.com>
Subject: Re: Servlet/web programming - user feedback during computations
Date: Tue, Aug 24, 1999, 5:35 AM


Andy,

you need to use the content-type: multipart/x-mixed-replace

I've rewritten your example so that it works. check it out:

    public void service(HttpServletRequest req, HttpServletResponse res)
    throws ServletException, IOException
    {


res.setContentType("multipart/x-mixed-replace;boundary=\"boundary\"");
        ServletOutputStream out = res.getOutputStream();

        out.println("--boundary");
        out.println("Content-Type: text/html\r");
        out.println("\r");
        out.println("Awaiting query results, please wait ...<br>\n");
        out.flush();
        try {
        Thread.sleep(3000);
        } catch (Exception e) {
            out.println("interrupted: " + e);
        }

        out.println("--boundary");
        out.println("Content-Type: text/html\r");
        out.println("\r");
        out.println("This is the end");
        out.println("--boundary--");
        out.flush();

    }


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 ...'
>
> and then when the results are returned, repopulate the same frame with
> the results. I've heard that I can do this with MIME, by setting the
> ContentType to 'multipart/mixed', and sending several 'parts', but cant
> get it to work properly.
>
> For example, if I do
>
> response.setContentType("multipart/mixed;boundary=my_identifier");
> ServletOutputStream     out=response.getOutputStream();
> out.println("--my_identifier");
> out.println("Content-Type: text/html\r");
> out.println("\r");
> out.println("Awaiting query results, please wait ...");
> out.flush();
>
> <... perform DB query ...>
>
> out.println(--my_identifier");
> out.println("Content-Type: text/html\r");
> out.println("\r");
> <... DB results ...>
> out.println("--my_identifier--");
> out.flush();
>
> But I get the whole text including the MIME separators displayed by the
> browser (Netscape 4.*). Has anyone got a working example ?, or a
> reference I can look at ?
>
> TIA
> --
> Andy
>
EndPart: 0
@


1.5
log
@null
@
text
@d7 1
a7 1
LastModifiedSecs: 935522577
d9 1
a9 1
SequenceNumber: 2
d11 98
@


1.4
log
@null
@
text
@d7 1
a7 1
LastModifiedSecs: 935522532
d9 2
a10 2
SequenceNumber: 1
Title: How to create a "
@


1.3
log
@null
@
text
@d7 1
a7 1
LastModifiedSecs: 935428937
d9 2
a10 2
SequenceNumber: 0
Title: New Item
@


1.2
log
@null
@
text
@d6 1
@


1.1
log
@null
@
text
@d4 1
@
