You are viewing a plain text version of this content. The canonical link for it is here.
Posted to asp@perl.apache.org by Fernando Munoz <fm...@lgecorp.com> on 2003/01/24 00:26:31 UTC

Redirect after $Response->Flush using $Server->RegisterCleanup

I'm trying to make an ASP script to do some work after the actual HTML has
been served and, as a result of that procedure to go, redirect, execute
another script where a new HTML page is served. I've tried using
$Server->RegisterCleanup after $Response->Flush but it seems like as
consequence of these operations $Server->Execute or $Server->Transfer are
not able to work, claiming that "no include "http://myserver/myscript" at
.....ASP line 1434". Is there a way to do such a thing or after cleaning no
object can pick the flag to redirect/transfer?

Thanks! 

Fernando I. Munoz


___________________________________________________ 
Lions Gate Entertainment, Inc.  [ AMEX: lgf ] 
Five Proud Years, One Independent Spirit.

---------------------------------------------------------------------
To unsubscribe, e-mail: asp-unsubscribe@perl.apache.org
For additional commands, e-mail: asp-help@perl.apache.org


Re: Redirect after $Response->Flush using $Server->RegisterCleanup

Posted by Josh Chamas <jo...@chamas.com>.
Fernando Munoz wrote:
> I'm trying to make an ASP script to do some work after the actual HTML has
> been served and, as a result of that procedure to go, redirect, execute
> another script where a new HTML page is served. I've tried using
> $Server->RegisterCleanup after $Response->Flush but it seems like as
> consequence of these operations $Server->Execute or $Server->Transfer are
> not able to work, claiming that "no include "http://myserver/myscript" at
> .....ASP line 1434". Is there a way to do such a thing or after cleaning no
> object can pick the flag to redirect/transfer?
> 
> Thanks! 
> 
> Fernando I. Munoz
> 

Architecturally, this just can't be done, because once you have served
the HTML, your opportunity to redirect with a HTTP header like
via $Response->Redirect is lost.

Just the same a internal redirect like a $Server->Transfer can only be
done during the main processing stage of the script output, not in
RegisterCleanup post-processing because by that point the HTTP request
is effectively done for the web client.

If you relax your requirement, say to have the user see output which
then redirects them to another page, then you can handle this logic
with client side javascript, but that javascript would be necessarily
not tied to backend execution logic.  If you a looking to deliver
the results of a long running report for example, you could have
a script loop on itself until the results are done, then render the
real report for example.

Regards,

Josh
________________________________________________________________
Josh Chamas, Founder                   phone:925-552-0128
Chamas Enterprises Inc.                http://www.chamas.com
NodeWorks Link Checking                http://www.nodeworks.com


---------------------------------------------------------------------
To unsubscribe, e-mail: asp-unsubscribe@perl.apache.org
For additional commands, e-mail: asp-help@perl.apache.org