title: how to display information in jsp page from controller Spring MVC
body: <p>I need display data in jsp with controller, i have <code>List</code> with information for print in jsp.</p>
  
  <p>When run this code i get error:</p>
  
  <blockquote>
    <p>HTTP Status 500 - Request processing failed; nested exception is
    org.springframework.beans.BeanInstantiationException: Failed to
    instantiate [entities.Pupil]: No default constructor found; nested
    exception is java.lang.NoSuchMethodException: entities.Pupil.()</p>
  </blockquote>
  
  <p><strong>Controller</strong></p>
  
  <pre><code> @Controller
     public class PupilController {
      @RequestMapping(value = "/add", method = RequestMethod.POST)
      public List add(@ModelAttribute Pupil pupil){
          System.out.println(pupil.toString());
          List&lt;Pupil&gt; pupilList = new ArrayList&lt;Pupil&gt;();
          pupilList.add(new Pupil(1, "Name", "Last", 13));
          pupilList.add(new Pupil(2, "Name", "Last", 55));
          pupilList.add(new Pupil(3, "Name", "Last", 41));
          return pupilList;
      }
     }
  </code></pre>
  
  <p><strong>index.jsp</strong></p>
  
  <pre><code>&lt;body&gt;
      &lt;h2&gt;Hello World!&lt;/h2&gt;
      &lt;a href="hello"&gt;click&lt;/a&gt;
      &lt;form action="/add" method="post"&gt;
          &lt;p&gt;1:&lt;/p&gt;&lt;input type="text" name="one"&gt;
          &lt;p&gt;2:&lt;/p&gt;&lt;input type="text" name="two"&gt;
          &lt;p&gt;3:&lt;/p&gt;&lt;input type="text" name="three"&gt;
          &lt;p&gt;4:&lt;/p&gt;&lt;input type="text" name="four"&gt;
          &lt;input type="submit" value="button"&gt;
      &lt;/form&gt;
  &lt;/body&gt;
  </code></pre>
  
  <p><strong>add.jsp</strong></p>
  
  <pre><code>&lt;body&gt;
    &lt;h3&gt;This is add.jsp&lt;/h3&gt;
    &lt;table&gt;
        &lt;thead&gt;
          &lt;tr&gt;
              &lt;td&gt;ID&lt;/td&gt;
              &lt;td&gt;NAME&lt;/td&gt;
              &lt;td&gt;LAST&lt;/td&gt;
              &lt;td&gt;YEAR&lt;/td&gt;
          &lt;/tr&gt;
        &lt;/thead&gt;
        &lt;tbody&gt;
          &lt;c:forEach  items="${pupilList}" var="tester"&gt;
              &lt;tr&gt;
                  &lt;td&gt;${tester.id}&lt;/td&gt;
                  &lt;td&gt;${tester.name}&lt;/td&gt;
                  &lt;td&gt;${tester.last}&lt;/td&gt;
                  &lt;td&gt;${tester.year}&lt;/td&gt;
              &lt;/tr&gt;
          &lt;/c:forEach&gt;
        &lt;/tbody&gt;
    &lt;/table&gt;
  &lt;/body&gt;
  </code></pre>