title: Struts2 get object attribute from select tag
body: <p>My problem is that I don't succeed in getting the attribute of the object of the list of my select tag.</p>
  
  <p>I have a select tag in my .jsp like this :</p>
  
  <pre><code>&lt;s:select list="listFonction" listKey="code" listValue="Libelle"
                  name="fonctionSelectionne" value="defaultFonction" /&gt;
  </code></pre>
  
  <p>and in my action, i declared an arraylist (with getter and setter) :</p>
  
  <pre><code>private ArrayList&lt;Fonction&gt; listFonction = new ArrayList&lt;Fonction&gt;(); 
  </code></pre>
  
  <p>I also have another class Fonction :</p>
  
  <pre><code>public class Fonction {
      private int code;
      private String libelle;
  
      public Fonction(int code, String libelle)
      {
          this.code = code;
          this.libelle =libelle;
      }
      public Fonction()
      {
  
      }
      public int getCode() {
          return code;
      }
  
      public void setCode(int code) {
          this.code = code;
      }
  
      public String getLibelle() {
          return libelle;
      }
  
      public void setLibelle(String libelle) {
          this.libelle = libelle;
      }
  }
  </code></pre>
  
  <p>To get the selected value in my action i declared (whith getter and setter):</p>
  
  <pre><code>Private String fonctionSelectionne;
  </code></pre>
  
  <p>but i am just abbled to get the code (<code>listkey</code>) of my object with <code>getFonctionSelectionne</code>. 
  I want to get the code attribute (<code>listkey</code>) and the <code>libelle</code> attribute (<code>listvalue</code>).</p>
  
  <p>Does anyone know how help me ?
  thanks</p>