[Catalyst] Can't seem to use forward or detach. Any special requirements?

J. Shirley jshirley at gmail.com
Mon Apr 27 13:41:06 GMT 2009


On Mon, Apr 27, 2009 at 9:55 PM, <kakimoto at tpg.com.au> wrote:

> Hello, J. Shirley,
>
>  Thank you for your explaination. It made things much clearer and
> confirmed a lotta things.
>
>  One last trivial question:
>
>
> > A redirect is to a URI, composed of however you make it.  If you
> > preserve
> > the request parameters, they will be there.  All you are doing is
> > sending a
> > string to the web browser, that the web browser will then go to
> > next.
>
>  How do you mean by 'preserve the request parameters'?  Does it mean by
> not having source code that would mutate the request parameter arguments?
>
>
> I 'd like to add another piece of information which I read from J
> Rockway's book.
> When executing a redirection, stash values do not persist. To make that
> happen, we have to
>
> 1) store the stash intended values to the flash
> 2) make sure flash_to_stash enabled (ie __PACKAGE__->config(session =3D> {
> flash_to_stash =3D> 1} );
>
> If I have missed something here, kindly let me know.
>
> Thank you guys (esp J Shirley).
>
>
>
> K. akimoto
>
>
>
Please respond just at the bottom of the message!

1) Preserve request parameters, you can access all the parameters through
$c->req->params and then append them when creating a new URL.  $c->uri_for(
'somewhere', $params ).
2) Yes, you have to copy any values you want to live longer than one request
to the flash.  You can access them via $c->flash or $c->stash.  I honestly
didn't know about the flash_to_stash config parameter, so try it and see.

You won't get better until you just try this stuff out.  Create a simple
Catalyst application you can use just to experiment.  Learn how the redirect
cycle affects the browser (especially after POST,
http://en.wikipedia.org/wiki/Post/Redirect/Get)

Throw away Catalyst apps are very useful for learning how HTTP works.
Catalyst's debug output is really fantastic.  Combine that with Firefox +
Firebug and the Network panel, you get a huge amount of information.

-J
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.scsys.co.uk/pipermail/catalyst/attachments/20090427/2b3a9=
72e/attachment.htm


More information about the Catalyst mailing list