Пример #1
0
 @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";
 }
Пример #2
0
 @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";
 }
Пример #3
0
 @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";
 }
Пример #4
0
 @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";
 }
Пример #5
0
 @RequestMapping(value = "/listUsers", method = RequestMethod.GET)
 public String listUsers(Model model) {
   List<UserBean> users = userService.all();
   model.addAttribute("users", users);
   return "listUsers";
 }