5

My website follows the Post-Redirect-Get pattern.
There seems to be 2 ways to deal with failed validation. Either:

  • Render the page with validation messages
  • Temporarily store the validation messages, and redirect to a GET that shows the messages

Do both of these implementations follow the PRG pattern?
Is there a more specific way to describe either of these patterns?

I am asking primarily for educational sake.

Alec
  • 8,529
  • 8
  • 37
  • 63
Scott Rippey
  • 15,614
  • 5
  • 70
  • 85
  • Related: http://stackoverflow.com/questions/599086/how-are-server-side-errors-handled-in-post-redirect-get-pattern – Thilo Nov 18 '11 at 06:58
  • I was also looking for some benefits & drawbacks of each approach. Any suggestions? – Scott Rippey Nov 18 '11 at 07:03
  • Here is another one about displaying messages after the redirect: http://stackoverflow.com/questions/1058497/how-to-display-messages-to-the-user-after-a-post-http-redirect – Thilo Nov 18 '11 at 07:12

1 Answers1

6

Since no one has answered, I'm going to suggest my own answer.

PRG Strict means that the POST redirects even if there is a validation error. It temporarily stores the validation messages, redirects to the same URL, and displays the validation messages.

PRG Loose means that the POST does not redirect when there are validation errors. The form will be redisplayed, along with the error messages.

How does this sound?

Scott Rippey
  • 15,614
  • 5
  • 70
  • 85