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 <[EMAIL PROTECTED]> wrote:

A. Pagaltzis wrote:

> * Matt S Trout <[EMAIL PROTECTED]> [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) = @_;
  $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 => '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: [email protected]
Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst
Searchable archive:
http://www.mail-archive.com/[email protected]/
Dev site: http://dev.catalyst.perl.org/




--
Roland Lammel

"Enjoy your job, make lots of money, work within the law. Choose any two."
_______________________________________________
List: [email protected]
Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/[email protected]/
Dev site: http://dev.catalyst.perl.org/

Reply via email to