@RequestMapping(value = "/{id}/control-letters", method = RequestMethod.GET) public String showControlLetters( @PathVariable("id") int id, Model model, final RedirectAttributes redirectAttributes) { if (!ticketsInvoiceService.invoiceExists(id)) throw new ResourceNotFoundException(); List<ControlLetter> controlLetters = controlLetterService.findAll(id); handleFlashMessages(redirectAttributes, model); model.addAttribute("ticketsInvoiceId", id); model.addAttribute("controlLetters", controlLetters); return "controlLetter/find"; }
@RequestMapping( value = "/{invoiceId}/control-letters/{controlLetterId}/rows", method = RequestMethod.GET) public String findControlLettersRows( @PathVariable("invoiceId") int invoiceId, @PathVariable("controlLetterId") int controlLetterId, Model model, RedirectAttributes redirectAttributes) { if (!ticketsInvoiceService.invoiceExists(invoiceId)) throw new ResourceNotFoundException(); handleFlashMessages(redirectAttributes, model); List<ControlLetterRow> controlLetterRows = controlLetterRowService.findAll(controlLetterId); model.addAttribute("controlLetterRows", controlLetterRows); model.addAttribute("controlLetterId", controlLetterId); model.addAttribute("invoiceId", invoiceId); return "controlLetterRow/find"; }