[jifty-devel] state_variables handling in Jifty::Web

Sean E. Millichamp sean at enertronllc.com
Sat May 13 15:01:08 EDT 2006


I have been trying (unsuccessfully) to do the following as a certain
if/else case in an action's take_action method:

Jifty->web->set_variable('foo', 'bar');

and then I tried getting to a new page with:

Jifty->web->redirect('/new/url');

and:

Jifty->web->next_page('/new/url');
return 1;

Both of which resulted in my being on the new page, but neither of which
resulted in my being able to access 'foo' using either the Mason <%args>
parameters or by using Jifty->web->get_variable('foo') in <%init>

I was looking in lib/Jifty/Web.pm and it seems to me that there is
something odd going on with state_variables.  There seems to be a set
that lives in Jifty->web->request and also a set that lives in
Jifty->web->{'state_variables'}.

The Jifty->web->set_variable call seems to set the ones
Jifty->web->{'state_variables'}, but all of the routines such as
redirect, next_page, goto, etc. all seem to ultimately use the ones on
Jifty->web->request except for Jifty->web->tangent.  I tried changing
the instances in Jifty::Web of {'state_variables'} to using the
request's state_variables instead, thinking perhaps there was some sort
of bug happening, but I still didn't have any luck.

So, I've spent far too much time pounding on this and I have made no
progress.  Can anyone tell if this is supposed to work and/or give me
some help on how I should go about doing this?

Thanks,
Sean

-- 
 Sean E. Millichamp, Enertron LLC, 586-757-1200 x102

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
Url : http://lists.bestpractical.com/pipermail/jifty-devel/attachments/20060513/2e2141ee/attachment.pgp


More information about the jifty-devel mailing list