コード例 #1
0
  @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";
  }
コード例 #2
0
  @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";
  }