title: MVC using java - returns NULL
body: <p>I am trying MVC using jsp servlets. But couldnt return the values from the database through bean. </p>
  
  <p>Below is my code:</p>
  
  <p><strong>JSP page</strong> :</p>
  
  <pre><code>        &lt;c:forEach var="pro" items="list"&gt;
           &lt;tr&gt;        
              &lt;td&gt;&lt;c:out value="${pro.reqno}"&gt;&lt;/c:out&gt;&lt;/td&gt;
              &lt;td&gt;&lt;c:out value="${pro.leave_Type}"&gt;&lt;/c:out&gt;&lt;/td&gt;
              &lt;td&gt;&lt;c:out value="${pro.no_of_days}"&gt;&lt;/c:out&gt;&lt;/td&gt;
              &lt;td&gt;&lt;c:out value="${pro.status}"&gt;&lt;/c:out&gt;&lt;/td&gt;
              &lt;td&gt;&lt;c:out value="${pro.balanceUnits}"&gt;&lt;/c:out&gt;&lt;/td&gt;
              &lt;td&gt;&lt;c:out value="${pro.totalUnits}"&gt;&lt;/c:out&gt;&lt;/td&gt;
          &lt;/tr&gt;
         &lt;/c:forEach&gt;
  </code></pre>
  
  <p><strong>Servlet</strong> :</p>
  
  <pre><code>            SummaryDetail summary=new SummaryDetail();
              ArrayList temp=new ArrayList();
              temp=summary.getSummary();
              request.setAttribute("list", temp);
              RequestDispatcher rd = request.getRequestDispatcher("JSP page");
              rd.forward(request, response);
  </code></pre>
  
  <p><strong>DAO class:</strong></p>
  
  <pre><code>    public ArrayList&lt;LeaveSummary&gt; getSummary(){
      ArrayList&lt;LeaveSummary&gt; rowArray = new ArrayList&lt;LeaveSummary&gt;();
       try{
          LeaveSummary getValuesFromDb=new LeaveSummary();
          Connection con = ConnectionProvider.getCon();
          Statement stmt = con.createStatement();    
          ResultSet rs = stmt.executeQuery("SELECT REQNO,USERNAME,LEAVEUNITS,LEAVETYPE,STATUS,TOTALUNITS,BALANCEUNITS FROM leave_request");
          while(rs.next())
          {
            getValuesFromDb.setReqno(rs.getInt(1));
            getValuesFromDb.setUser_name(rs.getString(2));
            getValuesFromDb.setNo_of_days(rs.getInt(3));
            getValuesFromDb.setLeave_Type(rs.getString(4));
            getValuesFromDb.setStatus(rs.getString(5));
            getValuesFromDb.setTotalUnits(rs.getInt(6));
            getValuesFromDb.setBalanceUnits(rs.getInt(7));
            rowArray.add(getValuesFromDb);
          }
      }
     catch(Exception e)
             {}
      return rowArray;
      }
  </code></pre>
  
  <p><strong>Bean class:</strong></p>
  
  <pre><code>public class LeaveSummary {
  
  public int getBalanceUnits() {
      return balanceUnits;
  }
  
  public void setBalanceUnits(int balanceUnits) {
      this.balanceUnits = balanceUnits;
  }
  
  public String getLeave_Type() {
      return leave_Type;
  }
  
  public void setLeave_Type(String leave_Type) {
      this.leave_Type = leave_Type;
  }
  
  public int getNo_of_days() {
      return no_of_days;
  }
  
  public void setNo_of_days(int no_of_days) {
      this.no_of_days = no_of_days;
  }
  
  public int getReqno() {
      return reqno;
  }
  
  public void setReqno(int reqno) {
      this.reqno = reqno;
  }
  
  public String getStatus() {
      return status;
  }
  
  public void setStatus(String status) {
      this.status = status;
  }
  
  public int getTotalUnits() {
      return totalUnits;
  }
  
  public void setTotalUnits(int totalUnits) {
      this.totalUnits = totalUnits;
  }
  
  public String getUser_name() {
      return user_name;
  }
  
  public void setUser_name(String user_name) {
      this.user_name = user_name;
  }
  private int reqno;
  private String leave_Type;
  private int no_of_days; // represents no of days of leave that is LeaveUnits field in DB
  private String user_name;
  private int balanceUnits;
  private String status;
  private int totalUnits;
  
  
  
  }
  </code></pre>
  
  <p>It does print any values in my JSP. Please explain me the mistake .Thanks in advance !!</p>