[cgiapp] CGI Params lost during forward?

jerry jerry at tr2.com
Mon Sep 7 10:48:20 EDT 2015


Hello,

    I have been making good use of the cgiapp "forward" functionality ( 
in CGI::Application::Plugin::Forward ).  Basically, I'll have a summary 
screen of some sort, and an action button - click the action button, the 
system does
something special, then forward back to the summary screen.

    That works well. But I just tried something different - from a child 
screen ( which needs some context to know which child screen to display 
) I called $self->forward() after doing something special in that child 
screen.  After that something special, the child screen bombed because 
its context was gone.

   That context ( really just an ID variable ) disappeared when I called 
$self->forward( 'CHILD_SCREEN_RM' ).  In other words - 
$cgi_params{CHILD_ID_VARIABLE} was now undefined.

   Is this how it's supposed to work?  Do CGI variables disappear during
a forward()?  If so, it'll make my life a little complicated, because 
I'll have to have code in the individual rm's ( which might be called 
from a forward() to check to see if the CGI variables still work....

   Or is it just that a new context is created by the forward, and I need 
to
do another new CGI object inside the rm to re-snarf everything?

   I just thought I'd ask before I do a TCAITIW ( Throw Code At It Till 
It Works ) :).


   Thanks in advance,

           - Jerry Kaidor




More information about the cgiapp mailing list