Skip to main content

Mini Project: Model, ModelAndView and the Post-Redirect-Get Flash Message

Learn Mini Project: Model, ModelAndView and the Post-Redirect-Get Flash Message (Model & View, Spring MVC) with worked examples, diagrams and interview questions. Free on JavaSchoolLab.

Mini Real-Time Project: Model, ModelAndView and the Post-Redirect-Get Flash Message Problem A form page needs data prepared for every request, a way to pass information to the next page after a redirect (a "saved" message), and the choice between returning a view name or a full ModelAndView. Requirements Add data with Model, ModelMap and ModelAndView. Use a @ModelAttribute method that supplies data for every handler of the controller. Redirect after saving, passing a one-time flash message. Show that the flash message disappears after one page view. Concepts Used Model / ModelMap /...

More lessons in Model & View