title: Binding an Object Array to a Front-End in Java Server Faces
body: <p>I have a Servlet which is called upon an Action and this Servlet is suppose to return a List of Objects. Now by having the Data Structure at the end of my Post my Servlet calls the <code>Person.fetch()</code> which returns an list/array of Persons.</p>
  
  <p>I want my Java Server Face to iterate through this list and call the getPresentation method on each object.</p>
  
  <p>Is this possible and if so, how?</p>
  
  <pre><code>public class Person
  {
      private String name;
      private String surname;
      private int age;
  
      /// -- GET --- ///
      public String getName() { return name; }
      public String getSurname() { return surname; }
      public int getAge() { return age; }
  
      /// -- SET --- ///
      public void setName(String name) { this.name = name; }
      public void setSurname(String surname) { this.surname = surname; }
      public void setAge(int age) { this.age = age; }
  
      /// -- OPERATIONS --- ///
      public String getPresentation()
      {
        return "Hi, I am " + getName() + " " + getSurname();
      }
  
      public Person(String name, String surname, int age)
      {
          this.name = name;
          this.surname = surname;
          this.age = age;
      }
  
  
      /// --- STATIC METHODS --- ///
      public static Person[] fetch()
      {
          Person[] toReturn = new Person[3];
          toReturn[0] = new Person("Filip", "Ekberg", 22);
          toReturn[1] = new Person("Adam", "Sandler", 99);
          toReturn[2] = new Person("Jon", "Skeet", Math.Rand());
      }
  }
  </code></pre>