@RequestMapping(value = "/add", method = RequestMethod.POST) public String addPerson(@ModelAttribute("person") Person person, BindingResult result) { personService.addPerson(person); return "redirect:/people/"; }
@RequestMapping("/delete/{personId}") public String deletePerson(@PathVariable("personId") Integer personId) { personService.removePerson(personId); return "redirect:/people/"; }
@RequestMapping("/") public String listPeople(Map<String, Object> map) { map.put("person", new Person()); map.put("peopleList", personService.listPeople()); return "people"; }