Post/Redirect/Get Pattern

Waffle adopts by default the PRG pattern. Any POST request from an action method that has a void return type or returns a null value will do a redirect as GET back to the posted page. The PRG paradigm as the advantage of allowing back button and refresh support for free.

The PRG pattern can become problematic for request-scoped controllers that need to display the content of the operation in the referring view. For this reason, the PRG behavior can be disabled via the @PRG annotation on the action method: