Skip to main content

PRG Pattern - Post/Redirect/Get

Learn PRG Pattern - Post/Redirect/Get (Form Handling, Spring MVC) with worked examples, diagrams and interview questions. Free on JavaSchoolLab.

Fresher Notes PRG stands for Post/Redirect/Get: the browser POSTs a form, the server answers with a redirect, and the browser then GETs a result page. Problem solved : the browser history keeps the final GET, so refresh or the back button never re-submits the form. Three steps : a @PostMapping handler processes the data, returns redirect:/url , and a @GetMapping handler renders the page.

More lessons in Form Handling