title: Struts2 Iterator property value (not working)
body: <p>I am trying to use the struts iterator to write some data from a List. Student is a class I have defined.
  The s:property when used with the value attribute does not seem to work at all.  </p>
  
  <p>I have the following code in the JSP:</p>
  
  <pre><code>&lt;s:iterator value="students" var="student"&gt;
      &lt;h2&gt;&lt;s:property /&gt;&lt;/h2&gt;
      &lt;h2&gt;&lt;s:property value="firstName" /&gt;&lt;/h2&gt;
      &lt;h2&gt;&lt;s:property value="student.firstName" /&gt;&lt;/h2&gt;
      &lt;h2&gt;&lt;s:property value="top.firstName" /&gt;&lt;/h2&gt;
      &lt;h2&gt;&lt;s:property value="[0].firstName" /&gt;&lt;/h2&gt;
      &lt;h2&gt;&lt;s:property value="#firstName" /&gt;&lt;/h2&gt;
  &lt;/s:iterator&gt;  
  </code></pre>
  
  <p>On the first property tag works. It prints the toString() of the Student object. All other property tags do not print anything at all.</p>
  
  <p>The toString() method of Student class is as follows:  </p>
  
  <pre><code>public String toString() {
      return firstName + " " + lastName + " " + Integer.valueOf(age);
  }
  </code></pre>
  
  <p>The Student class has the getFirstName() method as follows:</p>
  
  <pre><code>String getFirstName() {
      return firstName;
  }  
  </code></pre>
  
  <p>I am using Struts 2.1.6<br>
  There are no exceptions in the log files.<br>
  When viewing source of html, I just see the empty h2 tags.<br>
  I wonder what is the issue here. Any help is appreciated.  </p>