title: ArrayList of Bean..How to access the property of a bean using EL in jsp..? Throws NotFoundError exception
body: <p>I have an arraylist of employeebean resultEmployeeList set in request scope..
  I don't know if i was doing it the right way.. But here is the jstl code used in jsp..</p>
  
  <pre><code>&lt;c:forEach var="element" items="${resultEmployeeList} "&gt;
              &lt;tr&gt;
  
                  &lt;td&gt;
                  ${element.empId}
                  &lt;/td&gt;
                  &lt;td&gt; ${element.empname}&lt;/td&gt;
  
  
              &lt;/tr&gt;
          &lt;/c:forEach&gt;
  </code></pre>
  
  <p>when i try to access empId property of employeebean, it shows this error</p>
  
  <pre><code>javax.el.PropertyNotFoundException: Property 'empid' not found on type java.lang.String
  </code></pre>
  
  <p>Here is the employeebean</p>
  
  <pre><code>public class EmployeeBean {
  
  private int empId;
  private String empname;
  private boolean exceptionExist;
  public EmployeeBean() {
  }
  
  public int getEmpId() {
      return empId;
  }
  
  public void setEmpId(int empId) {
  
      this.empId = empId;
  }
  
  public EmployeeBean(int empId, String empname) {
      this.empId = empId;
      this.empname = empname;
  }
  
  public String getEmpname() {
      return empname;
  }
  
  public void setEmpname(String empname) {
      this.empname = empname;
  }
  
  public boolean exceptionExist(){
  return true;
  }
  </code></pre>
  
  <p>}</p>
  
  <p>This is where i put the resultEmployeeList</p>
  
  <pre><code>public boolean getEmployeesIn(ArrayList&lt;Integer&gt; empids,HttpServletRequest request) {
      ArrayList&lt;EmployeeBean&gt; employeeList=new ArrayList&lt;EmployeeBean&gt;();
      Iterator empidIterator=empids.iterator();
      while(empidIterator.hasNext()){
  
          employeeList.add(eObject.getEmployee((Integer)empidIterator.next()));
      }
      if(employeeList.isEmpty())
          return false;
      else{
      request.setAttribute("resultEmployeeList", employeeList);
      }
      return true;
  </code></pre>
  
  <p>Wherein eObject.getEmployee(..) calls this method..</p>
  
  <pre><code> public EmployeeBean getEmployee(int empId) {
  
      EmployeeBean eb = new EmployeeBean();
      try {
  
          String query = "select * from empschema.employee where empid=?";
          ps = con.prepareStatement(query);
          ps.setInt(1, empId);
          ResultSet rs = ps.executeQuery();
  
          if (!rs.next()) {
              eb=null;
              return eb;
  
          } else {
  
                  eb.setEmpId(rs.getInt(1));
                  eb.setEmpname(rs.getString(2));
  
          }
      } catch (SQLException ex) {
          Logger.getLogger(EmployeeDAO.class.getName()).log(Level.SEVERE, null, ex);
      }
      return eb;
  
  }
  </code></pre>