On Mar 31, 2008, at 9:54 AM, Jason Johnston wrote:
... here's how I accomplish the double-submit prevention:


var finished = false;
form.showForm(...);
if(!finished) {
  form.save(bean);
  myJavaService.doDatabaseUpdate(bean);
  finished = true;
}
cocoon.sendPage("confirmation-page");


So if the user reloads the confirmation page, the block that performs the database update will be skipped, and the confirmation page redisplayed. It's not a GET redirect, but performs the same function quite well.


Well, you can replace sendPage with redirect, and then user can reload confirmation page as long as he wants and won't be re-POSTing form contents :)

Also, it is often a good idea to invalidate the form processing continuation tree, to free up memory and -- even if user manages to submit the form again -- he will receive 404.

Vadim

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to