@RequestMapping(value = "/checkout.html", method = RequestMethod.GET) public ModelAndView infoPatient(Model model) throws SQLException { setAppContext(); List<Patient> patients = clinicService.getAllpatients(); model.addAttribute("patients", patients); ModelAndView checkout = new ModelAndView("CheckOut"); return checkout; }
@RequestMapping(value = "/checkout.html", method = RequestMethod.POST) public ModelAndView checkOut(Model model, @RequestParam String selectedPatient) throws SQLException { setAppContext(); clinicService.deletePatient(selectedPatient); List<Patient> patients = clinicService.getAllpatients(); model.addAttribute("patients", patients); ModelAndView checkout = new ModelAndView("CheckOut"); return checkout; }