[prev in list] [next in list] [prev in thread] [next in thread] 

List:       cgiapp
Subject:    Re: [cgiapp] Long running modes - how to display "please wait"?
From:       "Cees Hek" <ceeshek () gmail ! com>
Date:       2006-04-27 23:30:22
Message-ID: fd8e28ef0604271630y4089c7fbgeb2b1f935d4f2b8b () mail ! gmail ! com
[Download RAW message or body]

On 4/27/06, B Wooster <bwooster47@gmail.com> wrote:
> Found one more reason why I thought header_type('none') usage may run
> into conflict - the doc has this paragraph - but how can I not use
> print to display new lines ("done step1, done step2, etc") to the web
> page?
>
> From docs:
> IMPORTANT NOTE ABOUT RUN MODE METHODS
>
> Your application should *NEVER* print() to STDOUT. Using print() to
> send output to STDOUT (including HTTP headers) is exclusively the
> domain of the inherited run() method. Breaking this rule is a common
> source of errors. If your program is erroneously sending content
> before your HTTP header, you are probably breaking this rule.

That is why the header_type('none') is a bit of a hack.  You have to
handle stuff that CGI::App is suposed to handle for you.  When you set
header_type('none'), you have to send out the headers yourself, and
then you can call 'print' in your runmode to your hearts content, and
at the end you can just return ''.

Cheers,

Cees

---------------------------------------------------------------------
Web Archive:  http://www.mail-archive.com/cgiapp@lists.erlbaum.net/
              http://marc.theaimsgroup.com/?l=cgiapp&r=1&w=2
To unsubscribe, e-mail: cgiapp-unsubscribe@lists.erlbaum.net
For additional commands, e-mail: cgiapp-help@lists.erlbaum.net


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic