title: Spring MVC pass model to view then to controller
body: <p>I'm stuck with my code, I'm trying to pass the info of the object "Student". My scenario is like this: </p>
  
  <ol>
  <li><p>Registration Form (fill the details then press submit button go to next page)</p></li>
  <li><p>From this view the model will be printed out then press the next button again.</p></li>
  <li><p>This third page will just show the information again.</p></li>
  </ol>
  
  <p><strong>Q: How can i pass the same object and display it to other views?</strong></p>
  
  <p>My code is like this.</p>
  
  <p><strong>Registration view:</strong>
  </p>
  
  <pre><code>&lt;form action="/HamburgerProject/stuSubmitAdmissionForm.html" method="post"&gt;
      &lt;table&gt;
      &lt;tr&gt;
          &lt;td&gt;Name:&lt;/td&gt;          &lt;td&gt;&lt;input type="text" name="studentName"&gt;&lt;/td&gt;&lt;/tr&gt;
      &lt;tr&gt;
          &lt;td&gt;Age:&lt;/td&gt;           &lt;td&gt;&lt;input type="text" name="studentAge"&gt;&lt;/td&gt;&lt;/tr&gt;
      &lt;tr&gt;
      &lt;/table&gt;
      &lt;input type="submit" value="submit this"&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p></p>
  
  <p><strong>First Information View:</strong></p>
  
  <pre><code>&lt;form action="/HamburgerProject/stuSubmitAdmissionForm.html" method="post"&gt;
  &lt;table&gt;
      &lt;tr&gt;
          &lt;td&gt;Student's Name :&lt;/td&gt;
          &lt;td&gt;${student.studentName}&lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
          &lt;td&gt;Student's Age :&lt;/td&gt;
          &lt;td&gt;${student.studentAge}&lt;/td&gt;
      &lt;/tr&gt;
  &lt;/table&gt;
      &lt;input type="submit" value="send"/&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p><strong>Second Information View:</strong></p>
  
  <pre><code>&lt;table&gt;
      &lt;tr&gt;
          &lt;td&gt;Student's Name :&lt;/td&gt;
          &lt;td&gt;${student.studentName}&lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
          &lt;td&gt;Student's Age :&lt;/td&gt;
          &lt;td&gt;${student.studentAge}&lt;/td&gt;
      &lt;/tr&gt;
  &lt;/table&gt;
  </code></pre>
  
  <p><strong>My Controller:</strong></p>
  
  <pre><code>@RequestMapping(value="/stuAdmissionForm.html", method = RequestMethod.GET)
  public ModelAndView getStudentAdmissionForm() {
      ModelAndView model = new ModelAndView("AdmissionForm");
      return model;
  
  }
  
  @RequestMapping(value="/stuSubmitAdmissionForm.html", method = RequestMethod.POST) 
  public ModelAndView submitModelAttributeAnnotationAdmissionForm(@ModelAttribute("student") Student student) {
  
      ModelAndView model = new ModelAndView("AdmissionSuccess");
      return model;
  }
  
  @RequestMapping(value="/stuDisplayForm.html", method = RequestMethod.POST) 
  public ModelAndView getStudent(Student student) {
  
      ModelAndView model = new ModelAndView("NewForm");
      model.addObject(student);
  
      return  model;
  }
  </code></pre>
  
  <p>In attempting to re-display the information from second view to third view the object Student is not being passed.</p>