[Catalyst] Re: Redispatching actions

Roland Lammel rl at brabbel.net
Sun May 20 21:57:54 GMT 2007


But then again this code has to be added to every method, that is processing
form input. In case it's not there... the nightmare of reposting is back in
town.

I find it far more easy to actually perform a redirect at the end of an
action, that is intentional for the user and the developer.
I havn't come across any problems using redirects (not even on mobile
devices), so what kind of problems are you referring too?

But as usual, it's probably a matter of taste anyway.

+rl


On 5/20/07, Bernhard Graf <catalyst2 at augensalat.de> wrote:
>
> A. Pagaltzis wrote:
>
> > * Matt S Trout <dbix-class at trout.me.uk> [2007-05-20 15:55]:
> > > I worked on some Maypole apps a few years back that -didn't-
> > > redirect and behaved the way you're looking at implementing and
> > > the "wrong URL" problem turned out to be a usability nightmare
>
> sub update : Local {
>   my ($self, $c) =3D @_;
>   $c->detach('view') unless $c->request->method eq 'POST';
>   ...
>
> > That, plus the re-submit when the user hits the Back button.
>
>   ...
>   unless ($c->validate_token) { # Catalyst::Plugin::RequestToken
>     $c->stash(message =3D> 'Deja vu!'); # optional verbosity
>     $c->detach('view');
>   }
>   # do update here
>   ...
>   $c->remove_token;
>   $c->forward('view');
> }
>
> > > I'd strongly, strongly recommend against it, sending a 302
> > > really isn't that bad.
> >
> > Or 303. ;-)
>
> No need for redirects and all the problems they impose.
> --
> Bernhard Graf
>
> _______________________________________________
> List: Catalyst at lists.rawmode.org
> Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst
> Searchable archive:
> http://www.mail-archive.com/catalyst@lists.rawmode.org/
> Dev site: http://dev.catalyst.perl.org/
>



-- =

Roland Lammel

"Enjoy your job, make lots of money, work within the law. Choose any two."
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.scsys.co.uk/pipermail/catalyst/attachments/20070520/134f0=
a25/attachment.htm


More information about the Catalyst mailing list