title: JSF 2.0: use Enum values for selectOneMenu
body: <p>I'm using JSF 2.0 and want to fill a selectOneMenu with the values of my Enum.
  A simple example:</p>
  
  <pre><code>// Sample Enum
  public enum Gender {
    MALE("Male"),
    FEMALE("Female");
  
    private final String label;
  
    private Gender(String label) {
      this.label = label;
    }
  
    public String getLabel() {
      return this.label;
    }
  }
  </code></pre>
  
  <p>Unfortunately, i can't use Seam for my current project, which had a nice <code>&lt;s:convertEnum/&gt;</code> Tag that did most of the work. 
  In Seam, to use the values of the Enum, i had to write the following markup (and create a factory that provides the <code>#{genderValues}</code>:</p>
  
  <pre><code>&lt;!-- the Seam way --&gt;
  &lt;h:selectOneMenu id="persongender" value="#{person.gender}"&gt;
    &lt;s:selectItems var="_gender" value="#{genderValues}"" label="#{_gender.label}"/&gt;
    &lt;s:convertEnum/&gt;
  &lt;/h:selectOneMenu&gt;
  </code></pre>
  
  <p>The result is that i don't have to declare the Enum values explicitely anymore inside the markup.
  I know that this is not very easy in JSF &lt;2.0, but is there any new in JSF2 to help with this issue? Or does Weld help here somehow?
  If there is nothing new in JSF2, what's the easiest way to do it in JSF 1.2?</p>
  
  <p>Or can i even integrate the Seam JSF tag and the corresponding classes of Seam to get the same feature in a JavaEE6-App (without the Seam container)?</p>