I\'m learning Spring MVC and I\'ve looked everywhere to do just a basic controller to view data binding but nothing I\'ve tried as work. I can bind view posting back to cont
1) The contents of the modelMap are implicit in the JSP. You don't need to specify 'model' when you access them.
2) JSP-EL accesses fields via bean property accessors, not invoking methods. You don't specify the 'get' to call an actual method. You use the bean property name. e.g., ${person.firstName} to get the result of person.getFirstName();
@RequestMapping(value = "/", method = RequestMethod.GET)
public String home(Model model) {
Person person = new Person();
person.setFirstName("Kai");
person.setLastName("Cooper");
model.addAttribute("person", person);
return "home";
}
`
FirstName: ${person.firstName}
LastName: ${person.lastName}