@RequestMapping(value = "/incident/listAll", method = RequestMethod.GET) public String listAllIncidents(HttpServletRequest request, Model model) { List<Incident> incidents = incidentService.getUnresolvedIncidents(); model.addAttribute("incidents", incidents); return "listAll"; }
@RequestMapping(value = "/incident/reportIncident", method = RequestMethod.POST) public String listAllIncidentsPost(HttpServletRequest request, Model model) { List<Incident> incidents = new ArrayList<Incident>(); Incident incident = incidentService.getUnresolvedIncident( request.getParameter("end"), request.getParameter("location"), request.getParameter("description"), request.getParameter("status"), request.getParameter("start")); incidents.add(incident); model.addAttribute("incidents", incidents); return "listAll"; }