title: Fill selectManyListbox with items from database
body: <p>I am currently trying to go through the symptoms in a table and show them in a selectManyListbox although the listbox isn't appearing when I compile and run.</p>
  
  <p>index.html says that sym.symptomList and sym.Symptom are unknown properties</p>
  
  <p>index.html</p>
  
  <pre><code>&lt;h:selectManyListbox id ="list1" value="#{sym.symptomList}"&gt;
      &lt;f:selectItems value="#{sym.Symptom}" var="c"
          itemLabel="#{c.symptomName}" itemValue="#{c.symptomId}"/&gt;
  &lt;/h:selectManyListbox&gt;
  </code></pre>
  
  <p>Bean:</p>
  
  <pre><code>import javax.faces.bean.ManagedBean;
  import javax.faces.bean.SessionScoped;
  import java.util.*;
  import java.sql.*;
  
  @ManagedBean(name="sym")
  @SessionScoped
  public class SymptomBean{
  
  Connection con;
  Statement ps;
  ResultSet rs;
  private List symptomList = new ArrayList(); 
  
  public List getAllSym() {
  int i = 0;
  try
  {
      Class.forName("com.mysql.jdbc.Driver");
      con = DriverManager.getConnection(...) //ommitted details
      ps = con.createStatement();
      rs = ps.executeQuery("select * from symptoms");
      while (rs.next()) {
          symptomList.add(i, new Symptom(rs.getString(1), rs.getString(2)));
          i++;
          }
  }
  
  catch (Exception e)
  {
      System.out.println("Error Data : " + e.getMessage());
  }
  
  return symptomList;
  }
  
  public class Symptom{
  public String symptomId;
  public String symptomName;
  
      public Symptom(String symptomId, String symptomName){
      this.symptomId = symptomId;
      this.symptomName = symptomName;
      }
  
  public String getSymptomId(){
      return symptomId;
      }
  
  public String getSymptomName(){
      return symptomName;
      }
  }      
  </code></pre>
  
  <p>}</p>