Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a name for the PRG pattern that doesn't redirect on failed validation?

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.

like image 819
Scott Rippey Avatar asked Nov 18 '11 06:11

Scott Rippey


1 Answers

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?

like image 114
Scott Rippey Avatar answered Sep 25 '22 18:09

Scott Rippey