Mark,

> On 2005-12-20, Ricardo SIGNES <[EMAIL PROTECTED]> wrote:
>> 
>> We do this a lot, with a method that, simplified to remove other weird thin=
>> gs
>> we do, looks like this:
>> 
>>   sub redispatch {
>>     my ($self, $newclass) =3D @_;
>>     eval "require $newclass";
>>     die $@ if $@;
>> 
>>     # by default, at the end of the runmode, the value is sent
>>     # as the response.  we want to return the value instead.
>>     local $ENV{CGI_APP_RETURN_ONLY} =3D 1;
>> 
>>     $self->register_wrapper; # set up TT2 wrapping, a la Mason autohandler
>> 
>>     return $newclass->new(
>>       PARAMS =3D> { map { $_ =3D> $self->param($_) } $self->param },
>>       QUERY  =3D> $self->query,
>>     )->run;
>>   }
>> 
>> This works very nicely.
> 
> Interesting. This looks sort of like the sub_request that Catalyst has:
> 
>  http://search.cpan.org/perldoc?Catalyst::Plugin::SubRequest
> 
> Why not use an external redirect, giving the resulting page a bookmarkable
> URL? 
> 
> (It realize it takes a little more time and resources for an external
> redirect because it's a roundtrip to the browser and back.)
> 
Do you mean something like:

sub cgiapp_prerun
{
   my $self = shift;
   if ($self->session->param('logged_in'))
   {
      #do stuff
   }
   else
   {
      $self->header_type('redirect');
      $self->header_props(-url=>"index.cgi?rm=sl");
    }   #index.cgi is the instance script for the log-in
}

?

Brad


> 
> 
> ---------------------------------------------------------------------
> Web Archive:  http://www.mail-archive.com/[email protected]/
>               http://marc.theaimsgroup.com/?l=cgiapp&r=1&w=2
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 



---------------------------------------------------------------------
Web Archive:  http://www.mail-archive.com/[email protected]/
              http://marc.theaimsgroup.com/?l=cgiapp&r=1&w=2
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to