@GetMapping("/username/{username}/{name}")
public String usernameInput(Model model,
@PathVariable String username,
@PathVariable String name) throws InterruptedException {
Room room = parseRoom(username);
room.setName(name);
Room savedRoom = giveRoomService.saveRoom(giveRoom);
return "redirect:/view/" + savedRoom.getId();
}
Другой
@GetMapping("/view/{id}")
public String getRoomById(
@PathVariable Long id, Model model) {
Room room = roomService.getGiveRoomById(id);
model.addAttribute("give", room);
return "view";
}