示例#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";
 }