Advertisement
Guest User

Untitled

a guest
Jul 17th, 2019
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.71 KB | None | 0 0
  1. @GetMapping("/add")
  2. public String addGroup(Model model) {
  3. Group group = new Group();
  4. model.addAttribute(group);
  5. return "groups/show-group-form";
  6. }
  7.  
  8. @GetMapping("/update")
  9. public String updateGroup(Model model,@RequestParam("GroupId") Long Id ) {
  10. model.addAttribute("group",groupService.findById(Id));
  11. model.addAttribute("update", true);
  12. return "groups/show-group-form";
  13. }
  14.  
  15. @PostMapping("/processform")
  16. public String processForm(Model model,@ModelAttribute("Group") Group newGroup ) {
  17. groupService.add(newGroup);
  18. model.addAttribute("groups",groupService.getGroupsList());
  19. return "groups/list-groups";
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement