title: Data not populating on page after processing post request
body: <p>it shows data when get request is send properly but when i save data with post requset then again the page is rendered data is not coming on page</p>
  
  <p>This is my controller code </p>
  
  <pre><code>@RequestMapping(value = "/incident", method = RequestMethod.GET)
  public String add_incident(Model model,HttpSession session) {
  
      try{
      List&lt;AddIncident&gt; fetchincident = incService.fetchIncident();
      String user_id = ""+session.getAttribute("session");
  
      List&lt;AddIncident&gt; fetchuserincident = incService.fetchuserincident(user_id);
  
      //group work
  
              User user = new User();
      model.addAttribute("user", user);
  
      List&lt;User&gt; fetchListByUsername = userService.findListByUserName(user_id);
  
      String department = fetchListByUsername.get(0).getDepartment();
      List&lt;AddIncident&gt; fetchgroupincident = incService.fetchgroupincident(department);
  
      System.out.println(fetchgroupincident.get(0).getAssignTo());
      System.out.println(fetchgroupincident.get(0).getSeverity());
      model.addAttribute("fetchincident", fetchincident);
      model.addAttribute("fetchgroupincident", fetchgroupincident);
      model.addAttribute("fetchuserincident", fetchuserincident);
      }catch(Exception e){
          e.printStackTrace();    }
  
      AddIncident incident = new AddIncident();
      model.addAttribute("incident", incident);
  
  
      return "incident";
  }
  
  @RequestMapping(value = "/incident", method = RequestMethod.POST)
  public String add_incident(
          @Valid @ModelAttribute("incident") AddIncident incident,
          BindingResult result, Model model,HttpSession session) {
      if (result.hasErrors()) {
          return "incident";
      } else {
  
          User user=new User();
          System.out.println(""+session.getAttribute("session"));
          String user_id = ""+session.getAttribute("session");
          System.out.println(user_id);
  
          List&lt;User&gt; fetchListByUsername = userService.findListByUserName(user_id);
  
          String department = fetchListByUsername.get(0).getDepartment();
          System.out.println(department);
  
          try{
          List&lt;User&gt; fetchgroupuser = userService.findListByGroup(department);
  
  
          ArrayList&lt;String&gt; email=new ArrayList&lt;String&gt;();
  
          System.out.println(email);
          for(User use:fetchgroupuser){
              email.add(use.getEmail());
          }
  
          String[] to = new String[email.size()];
          to = email.toArray(to);
          System.out.println(to);
  
                  /*new String[]{"irasoftwares6@gmail.com","bluemagictest@gmail.com"};*/
          String from = "Anurag.yv19@gmail.com";
          String sub= "Incident Management System"; 
          String msgBody="New Incident created"; 
          incService.save(incident);
  
  
  
  
          emailService.sendEmail(to , from, sub, msgBody);
          }catch(ArrayIndexOutOfBoundsException e){e.printStackTrace();}
          incident_logger.log(INCIDENT, incident.getRef_id()+"   \n Assigned to :"+session.getAttribute("session"));
          model.addAttribute("message", "Saved incident details");
          return "incident";
      }
  }
  </code></pre>
  
  <p>my jsp code</p>
  
  <pre><code>&lt;div class="table-responsive" id="inc-table" style="min-height: 280px;"&gt;
                  &lt;form action="" method="get"&gt;
              &lt;div class="input-group"&gt;
                  &lt;!-- USE TWITTER TYPEAHEAD JSON WITH API TO SEARCH --&gt;
                  &lt;input class="form-control" id="system-search" name="q" placeholder="Search for" required&gt;
                  &lt;span class="input-group-btn"&gt;
                      &lt;button type="submit" class="btn btn-default"&gt;&lt;i class="glyphicon glyphicon-search"&gt;&lt;/i&gt;&lt;/button&gt;
                  &lt;/span&gt;
              &lt;/div&gt;
          &lt;/form&gt;
  
                  &lt;table  class="table table-list-search table-bordered table-stripped table-hover"&gt;
                      &lt;thead&gt;
                          &lt;tr&gt;
                              &lt;th&gt;Ref. No.&lt;/th&gt;
                              &lt;th&gt;Created&lt;/th&gt;
                              &lt;th&gt;Severity&lt;/th&gt;
                              &lt;th&gt;State&lt;/th&gt;
                              &lt;th&gt;Assigned&lt;/th&gt;
                              &lt;th&gt;Est&lt;/th&gt;
                              &lt;th&gt;Description&lt;/th&gt;
                              &lt;th&gt;Location&lt;/th&gt;
                              &lt;th&gt;Config-item&lt;/th&gt;
                              &lt;th&gt;Symptom Code&lt;/th&gt;
                              &lt;th&gt;Closure Code&lt;/th&gt;
                              &lt;th&gt;Submitted BY&lt;/th&gt;
                          &lt;/tr&gt;
                      &lt;/thead&gt;
                          &lt;tbody&gt;
                          &lt;c:forEach var="fetchuserincident" items="${fetchuserincident}"&gt;
                          &lt;tr&gt;
  
                              &lt;td id="1" class="click" &gt;&lt;a href=""/&gt;${fetchuserincident.ref_id}&lt;/td&gt;
                              &lt;td&gt;${fetchuserincident.created}&lt;/td&gt;
                              &lt;td&gt;${fetchuserincident.severity}&lt;/td&gt;
                              &lt;td&gt;${fetchuserincident.state}&lt;/td&gt;
                              &lt;td&gt;${fetchuserincident.assignTo}&lt;/td&gt;
                              &lt;td&gt;${fetchuserincident.escalation}&lt;/td&gt;
                              &lt;td&gt;${fetchuserincident.description}&lt;/td&gt;
                              &lt;td&gt;${fetchuserincident.location}&lt;/td&gt;
                              &lt;td&gt;${fetchuserincident.config_Item}&lt;/td&gt;
  
                              &lt;td&gt;${fetchuserincident.symptom_code}&lt;/td&gt;
                              &lt;td&gt;${fetchuserincident.closure_code}&lt;/td&gt;
                              &lt;td&gt;${fetchuserincident.submittedby}&lt;/td&gt;
                              &lt;td&gt; &lt;button id="editbtn" class="fa fa-pencil"&gt;Edit&lt;/button&gt;&lt;/td&gt;
  
                              &lt;/tr&gt;
                                              &lt;/c:forEach&gt;
  
                      &lt;/tbody&gt;
  
                  &lt;/table&gt;
  
  
  
  
              &lt;/div&gt;
  
              &lt;hr&gt;
              &lt;br&gt;
  </code></pre>
  
  
  
                      <strong>My Group Work</strong>
                      
                  
                      
                      
                      
                          
                      
                  
              
  
                      
                          
                              
                                  Ref. No.
                                  Created
                                  Severity
                                  State
                                  Assigned
                                  Est
                                  Description
                                  Location
                                  Config-item
                                  Symptom Code
                                  Closure Code
                                  Submitted BY
                              
                          
                              
                              
                              
  
                                  ${fetchgroupincident.ref_id}
                                  ${fetchgroupincident.created}
                                  ${fetchgroupincident.severity}
                                  ${fetchgroupincident.state}
                                  ${fetchgroupincident.assignTo}
                                  ${fetchgroupincident.escalation}
                                  ${fetchgroupincident.description}
                                  ${fetchgroupincident.location}
                                  ${fetchgroupincident.config_Item}
                                      ${fetchgroupincident.symptom_code}
                                  ${fetchgroupincident.closure_code}
                                  ${fetchgroupincident.submittedby}
  
  
                                           Edit