You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by Martin Moss <Ma...@btinternet.com> on 2003/02/14 14:24:49 UTC

Please wait Handler

All,

I was wondering if it is possible to Create a Handler that points a user at a page with an animated gif saying something like "Please wait", and then when my other handlers have finished display the page results I want from my mod perl handlers.

I guess in a nutshell I'm wondering if there is a way to send HTML headers to a browser which tells it to scrap the html it has already received and display the new HTML I am passing it.

If this isn't possible, can somebody point me in the direction of a 'please wait' mechanism that is possible - Is there one?

Kind regards

Marty

Re: Please wait Handler

Posted by Lee Goddard <ho...@LeeGoddard.com>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: MD5

Hi Martin,

On Friday, February 14, 2003 at 2:24:49 PM, you wrote:
MM> I was wondering if it is possible to Create a Handler that points a user at a page with an animated gif saying something like "Please wait", and then when my other handlers have finished display
MM> the page results I want from my mod perl handlers.
MM> I guess in a nutshell I'm wondering if there is a way to send HTML headers to a browser which tells it to scrap the html it has already received and display the new HTML I am passing it.
MM> If this isn't possible, can somebody point me in the direction of a 'please wait' mechanism that is possible - Is there one?

I don't know about the handlers, but I've never read of an
HTTP header to do as you ask.

What I do, good or not I don't know, is send the Please Wait message
as a load of HTML 'div' elements with their 'display' CSS attribute
set to 'hidden'. As my program works, it sends at regular intervals
little bits of JavaScript to tell the client to display another DIV.
This has the effect of a progress bar incrementing. When I do not
know how much I have to do, I have the progress bar reverse itself
once full.

When the program is ready to move on, it sends some JS to redirect
the client to the next URI.

I've found that animated GIFs don't work in this situation since
the IE client I work with needs to get the whole document before it
will look for elements linked to from that document - including
images and stylesheets.

Hope this helps.
- --
Cheers
 Lee                            mailto:home@LeeGoddard.com

$$=qw$808273788400074285838400657879847269820080698276007265677569820727$;
$$=~s$(\d\d)$\$_.=chr(\$1+32)$ge;eval;

-----BEGIN PGP SIGNATURE-----
Version: 2.6

iQCVAwUAPkzzA6drfekeF/QBAQFgQwP/Sm/840HI2pD+I4jhRqoqino2P1+Cza56
OI9aA8UYutvreXkWaoaSrmGEiPMDuaLhcOHi1fAgDCZ8k33VPrhVlgZyHz97LqAG
pwrS0/cOPW+55SFQjw9RmmyIc9i6b4TPGOPury0RbaHbO+RIH23Dsag4Si5uEHuX
SncVZ6Adz50=
=I26o
-----END PGP SIGNATURE-----


Re: Please wait Handler

Posted by Dmitri Tikhonov <dm...@netilla.com>.
On Fri, Feb 14, 2003 at 08:38:08PM +0100, Lee Goddard wrote:
> Have you got a URI to that, please? Last time I push with IE
> I gave up unsatisfied, but now I feel optimistic :)

I don't have _the_ way for you to do it, but one live example is Apache's
bug database: http://nagoya.apache.org/bugzilla/index.html.  Run some
queries and capture packets and see how it works.

  - Dmitri.


Re[2]: Please wait Handler

Posted by Lee Goddard <ho...@LeeGoddard.com>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: MD5

Hi Dmitri,

On Friday, February 14, 2003 at 6:11:01 PM, you wrote:

>> You can also try server push (with the "Content-type:
>> multipart/x-mixed-replace" header), but I'm not sure how consistently
>> today's browsers implement that.

DT> I know bugzilla does just that ("Please wait" message when a query is
DT> performed), and it works on my Netscape 4.7, Mozilla, and IE browsers.
DT> I think it is a much better solution than that given by Randal.

Have you got a URI to that, please? Last time I push with IE
I gave up unsatisfied, but now I feel optimistic :)


- --
Cheers
 Lee                            mailto:home@LeeGoddard.com

$$=qw$808273788400074285838400657879847269820080698276007265677569820727$;
$$=~s$(\d\d)$\$_.=chr(\$1+32)$ge;eval;

-----BEGIN PGP SIGNATURE-----
Version: 2.6

iQCVAwUAPk1FoKdrfekeF/QBAQHifQP+OfKIuPHGuBlN/Sh/mo6NYEb1mkUliEAk
mi7Opyvhy2dhP5ytZG6bftJxGkjSQinIW+gErA8I5KYRqxLN0gYSOoWngjRc/wwK
o6iVi/AQQn/+itDsJeAXScGpyFBq3uhipr7q7hFUZr5kUNdXP+k74KJlk9GNL4Rn
tPqzWvvKliY=
=ldST
-----END PGP SIGNATURE-----


Re: Please wait Handler

Posted by Dmitri Tikhonov <dm...@netilla.com>.
On Fri, Feb 14, 2003 at 11:08:48AM -0500, Perrin Harkins wrote:
> Martin Moss wrote:
> >I was wondering if it is possible to Create a Handler that points a user 
> >at a page with an animated gif saying something like "Please wait", and 
> >then when my other handlers have finished display the page results I 
> >want from my mod perl handlers.
> 
> The classic answer to this problem is described by Randal in one of his 
> Web Techniques columns:
> http://www.stonehenge.com/merlyn/WebTechniques/col20.html
> 
> You can also try server push (with the "Content-type: 
> multipart/x-mixed-replace" header), but I'm not sure how consistently 
> today's browsers implement that.

I know bugzilla does just that ("Please wait" message when a query is
performed), and it works on my Netscape 4.7, Mozilla, and IE browsers.
I think it is a much better solution than that given by Randal.

  - Dmitri.


Re: Please wait Handler

Posted by David Dick <da...@iprimus.com.au>.
Last time I experimented with Server-Push, the only browser that 
implemented it was Netscape 4.*.  Mozilla didn't and IE didn't.  Which 
is a pity cos it's a really useful technique.

Perrin Harkins wrote:

> Martin Moss wrote:
>
>> I was wondering if it is possible to Create a Handler that points a 
>> user at a page with an animated gif saying something like "Please 
>> wait", and then when my other handlers have finished display the page 
>> results I want from my mod perl handlers.
>
>
> The classic answer to this problem is described by Randal in one of 
> his Web Techniques columns:
> http://www.stonehenge.com/merlyn/WebTechniques/col20.html
>
> You can also try server push (with the "Content-type: 
> multipart/x-mixed-replace" header), but I'm not sure how consistently 
> today's browsers implement that.
>
> - Perrin
>
>


Re: Please wait Handler

Posted by Perrin Harkins <pe...@elem.com>.
Martin Moss wrote:
> I was wondering if it is possible to Create a Handler that points a user 
> at a page with an animated gif saying something like "Please wait", and 
> then when my other handlers have finished display the page results I 
> want from my mod perl handlers.

The classic answer to this problem is described by Randal in one of his 
Web Techniques columns:
http://www.stonehenge.com/merlyn/WebTechniques/col20.html

You can also try server push (with the "Content-type: 
multipart/x-mixed-replace" header), but I'm not sure how consistently 
today's browsers implement that.

- Perrin


Re: is moderator/admin available?

Posted by George Valpak <gv...@yahoo.com>.
At 09:21 AM 2/18/2003 +1100, Stas Bekman wrote:
>George Valpak wrote:
>>Hey, is there a moderator available that can get the list admin to stop the madness of endless repeats?
>
>I'm not a moderator, but if you post to modperl-help@perl.apache.org, you will receive the information you are looking for.

Thanks Stas - someone replied off list and that started repeating to, which exonerated the list itself and pointed the finger squarely at my yahoo account... I seem to have cleared up the trouble now...

GV


Re: is moderator/admin available?

Posted by Stas Bekman <st...@stason.org>.
George Valpak wrote:
> Hey, is there a moderator available that can get the list admin to stop the madness of endless repeats?

I'm not a moderator, but if you post to modperl-help@perl.apache.org, you will 
receive the information you are looking for.

__________________________________________________________________
Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/     mod_perl Guide ---> http://perl.apache.org
mailto:stas@stason.org http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com


is moderator/admin available?

Posted by George Valpak <gv...@yahoo.com>.
Hey, is there a moderator available that can get the list admin to stop the madness of endless repeats?

GV


Re: Please wait Handler

Posted by Martin Moss <Ma...@btinternet.com>.
Thanks for all your help guys,

Will have a think about it,

Marty
----- Original Message -----
From: "Randal L. Schwartz" <me...@stonehenge.com>
To: "Perrin Harkins" <pe...@elem.com>
Cc: "Andrew Ho" <an...@tellme.com>; "Martin Moss"
<Ma...@btinternet.com>; <mo...@apache.org>
Sent: Sunday, February 16, 2003 7:43 AM
Subject: Re: Please wait Handler


> >>>>> "Perrin" == Perrin Harkins <pe...@elem.com> writes:
>
> Perrin> Andrew Ho wrote:
> >> Make an HTML page which does a form submit to pleasewait.pl.
pleasewait.pl
> >> just displays an HTML page with an animated "please wait" image on it,
and
> >> its headers include the following header:
> >> Refresh: 1; url=http://www.example.com/getresults.pl?args...
>
> Perrin> That's what Randal does in the article that I posted (although his
> Perrin> puts it in a META tag).  It's called client pull, and was
introduced
> Perrin> by Netscape at the same time as server push.
>
> There's a later better example of that (self-cleaning, etc)
> at <http://www.stonehenge.com/merlyn/LinuxMag/col39.html>.
>
> I usually don't recycle ideas unless I can put a new slant on it.
> Check out the new slant. :)
>
> --
> Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777
0095
> <me...@stonehenge.com> <URL:http://www.stonehenge.com/merlyn/>
> Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
> See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl
training!
>


Re: Please wait Handler

Posted by "Randal L. Schwartz" <me...@stonehenge.com>.
>>>>> "Perrin" == Perrin Harkins <pe...@elem.com> writes:

Perrin> Andrew Ho wrote:
>> Make an HTML page which does a form submit to pleasewait.pl. pleasewait.pl
>> just displays an HTML page with an animated "please wait" image on it, and
>> its headers include the following header:
>> Refresh: 1; url=http://www.example.com/getresults.pl?args...

Perrin> That's what Randal does in the article that I posted (although his
Perrin> puts it in a META tag).  It's called client pull, and was introduced
Perrin> by Netscape at the same time as server push.

There's a later better example of that (self-cleaning, etc)
at <http://www.stonehenge.com/merlyn/LinuxMag/col39.html>.

I usually don't recycle ideas unless I can put a new slant on it.
Check out the new slant. :)

-- 
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<me...@stonehenge.com> <URL:http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!

Re: Please wait Handler

Posted by Perrin Harkins <pe...@elem.com>.
Andrew Ho wrote:
> Make an HTML page which does a form submit to pleasewait.pl. pleasewait.pl
> just displays an HTML page with an animated "please wait" image on it, and
> its headers include the following header:
> 
>     Refresh: 1; url=http://www.example.com/getresults.pl?args...

That's what Randal does in the article that I posted (although his puts 
it in a META tag).  It's called client pull, and was introduced by 
Netscape at the same time as server push.

- Perrin


Re: Please wait Handler

Posted by Andrew Ho <an...@tellme.com>.
Hello,

MM>I guess in a nutshell I'm wondering if there is a way to send HTML
MM>headers to a browser which tells it to scrap the html it has already
MM>received and display the new HTML I am passing it.
MM>
MM>If this isn't possible, can somebody point me in the direction of a
MM>'please wait' mechanism that is possible - Is there one?

If the long-running process will finish within the usual amount of time
that a browser waits before timing out, this is easy--use an HTTP Refresh
header. For example:

Long running operation is http://www.example.com/getresults.pl
Please wait page is at http://www.example.com/pleasewait.pl

Make an HTML page which does a form submit to pleasewait.pl. pleasewait.pl
just displays an HTML page with an animated "please wait" image on it, and
its headers include the following header:

    Refresh: 1; url=http://www.example.com/getresults.pl?args...

The browser displays the HTML on that page, and then a second later (the 1
in the Refresh header, it could be longer), the browser fetches the second
page. Since the HTML and animated image are already loaded, the user sees
that while waiting for the second page to load.

If the process runs a very long time, you are safer writing getresults.pl
(in this example) to be able to kick off a long-running job in the
background, and just display the status of the job. You can snarf a
Refresh header in that too so that users see it constantly updated.

Humbly,

Andrew

----------------------------------------------------------------------
Andrew Ho               http://www.tellme.com/       andrew@tellme.com
Engineer                   info@tellme.com          Voice 650-930-9062
Tellme Networks, Inc.       1-800-555-TELL            Fax 650-930-9101
----------------------------------------------------------------------