title: How to populate options of h:selectOneMenu from database?
body: <p>I am creating a web application, where you have to read a list of objects / entities from a DB and populate it in a JSF <code>&lt;h:selectOneMenu&gt;</code>. I am unable to code this. Can someone show me how to do it?</p>
  
  <p>I know how to get a <code>List&lt;User&gt;</code> from the DB. What I need to know is, how to populate this list in a <code>&lt;h:selectOneMenu&gt;</code>.</p>
  
  <pre><code>&lt;h:selectOneMenu value="#{bean.name}"&gt;
      ...?
  &lt;/h:selectOneMenu&gt;
  </code></pre>