title: How to access enum properties in EL?
body: <p>Given the following <code>enum</code>.</p>
  
  <pre><code>public enum Constants
  {
      PAGE_LINKS(10);
      //Other constants as and when required.
  
      private final int value;
  
      private Constants(int value){
          this.value = value;
      }
  
      public int getValue(){
          value;
      }    
  }
  </code></pre>
  
  <p>This <code>enum</code> is placed under an application scoped bean like so,</p>
  
  <pre><code>@ManagedBean
  @ApplicationScoped
  public final class ConstantsBean
  {
      private Constants constants;
  
      public ConstantsBean() {}
  
      public Constants getConstants() {
          return constants;
      }
  }
  </code></pre>
  
  <p>How to access the value of <code>PAGE_LINKS</code> in EL?</p>
  
  <pre><code>&lt;p:dataGrid pageLinks="#{}".../&gt;
  </code></pre>
  
  <p>What should be written in <code>#{}</code>? Is it possible?</p>
  
  <hr>
  
  <p><strong>EDIT:</strong></p>
  
  <p>Modifying the bean in the following way,</p>
  
  <pre><code>@ManagedBean
  @ApplicationScoped
  public final class ConstantsBean
  {
      public ConstantsBean() {}
  
      public int getValue(Constants constants) {
          return constants.getValue();
      }
  }
  </code></pre>
  
  <p>and then accessing in EL like so,</p>
  
  <pre><code>&lt;p:dataGrid pageLinks="#{constantsBean.getValue('PAGE_LINKS')}".../&gt;
  </code></pre>
  
  <p>somehow works but I don't believe in this ugly way.</p>