Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @GetMapping("/add")
- public String addGroup(Model model) {
- Group group = new Group();
- model.addAttribute(group);
- return "groups/show-group-form";
- }
- @GetMapping("/update")
- public String updateGroup(Model model,@RequestParam("GroupId") Long Id ) {
- model.addAttribute("group",groupService.findById(Id));
- model.addAttribute("update", true);
- return "groups/show-group-form";
- }
- @PostMapping("/processform")
- public String processForm(Model model,@ModelAttribute("Group") Group newGroup ) {
- groupService.add(newGroup);
- model.addAttribute("groups",groupService.getGroupsList());
- return "groups/list-groups";
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement