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.

3

1 Answer 1

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?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.