@RequestMapping(value = "/{pageNo}", method = RequestMethod.GET) public String index(@PathVariable() Integer pageNo, Model model) { logger.debug("PaymentsController:[index] Passing through..."); Iterable<Payments> result = paymentsService.findAll(pageNo, PAGE_SIZE, "customerNumber"); model.addAttribute("result", result); int totalCount = (int) paymentsService.count(); addPageAttr(paymentsService.calcPage(totalCount, pageNo, PAGE_SIZE), model); return "Payments/index"; }
@RequestMapping(value = "/detail/{id}", method = RequestMethod.GET) public String detail(@PathVariable(value = "id") String id, Model model) { logger.debug("PaymentsController:[detail] Passing through..."); Payments payment = paymentsService.findById(id); String json = "{}"; if (payment != null) { json = JsonLoader.toJson(payment); } Customers customer = customersService.findByPk(payment.getCustomerNumber()); model.addAttribute("payment", payment); model.addAttribute("customer", customer); model.addAttribute("json", json); return "Payments/detail"; }