@RequestMapping(value = "/updateUser", method = RequestMethod.POST) public String saveUser(Model model, UserBean userForm) { userService.update(userForm.getIdentity(), userForm); List<UserBean> users = userService.all(); model.addAttribute("users", users); return "listUsers"; }
@RequestMapping(value = "/deleteUser", method = RequestMethod.GET) public String deleteUser(Model model, @RequestParam String identity) { userService.delete(identity); List<UserBean> users = userService.all(); model.addAttribute("users", users); return "listUsers"; }
@RequestMapping(value = "/createUser", method = RequestMethod.POST) public String createNewUser(Model model, UserBean userForm) { userService.create(userForm); List<UserBean> users = userService.all(); model.addAttribute("users", users); return "listUsers"; }
@RequestMapping(value = "/updateUser", method = RequestMethod.GET) public String updateUser(Model model, @RequestParam String identity) { UserBean userForm = userService.read(identity); model.addAttribute("headerText", "Update User"); model.addAttribute("buttonText", "Update"); model.addAttribute("userForm", userForm); return "updateUser"; }
@RequestMapping(value = "/listUsers", method = RequestMethod.GET) public String listUsers(Model model) { List<UserBean> users = userService.all(); model.addAttribute("users", users); return "listUsers"; }