Skip to main content

ModelMap

Learn ModelMap (Model & View, Spring MVC) with worked examples, diagrams and interview questions. Free on JavaSchoolLab.

Fresher Notes ModelMap is a LinkedHashMap<String, Object> subclass in Spring that holds model attributes and keeps the order in which you added them. Use it as a handler parameter: String show(ModelMap map) , then map.addAttribute("k", v) . Same job as Model : both pass data to the view; ModelMap just exposes the map methods as well.

More lessons in Model & View