title: Struts2 Collection Validation
body: <p>Is there anyway to validate a collection of objects in a myAction-validation.xml file?</p>
  
  <p>I have some JSP:</p>
  
  <pre><code>&lt;s:iterator value="messageTypes" status="status"&gt;
  &lt;tr&gt;
     &lt;td&gt; &lt;s:property value="messageType" /&gt; &lt;/td&gt;
     &lt;td&gt; &lt;s:checkbox name="messageTypes[%{#status.index}].enabled" value="enabled" label="" /&gt; &lt;/td&gt;
     &lt;td&gt; &lt;s:textfield name="messageTypes[%{#status.index}].reminderDate" value="%{reminderDate}" label="" labelSeparator="" /&gt; &lt;/td&gt;
     &lt;td&gt; 
         &lt;s:select name="messageTypes[%{#status.index}].reminderHour" list="hours" label="Hour"  /&gt; 
         &lt;s:select name="messageTypes[%{#status.index}].reminderMinute" list="minutes" label="Minute" /&gt; &lt;/td&gt; 
     &lt;td&gt; &lt;s:textfield name="messageTypes[%{#status.index}].reminderTo"                           value="%{reminderTo}" label="" labelSeparator="" /&gt; &lt;/td&gt;
  &lt;/tr&gt;
  &lt;/s:iterator&gt;
  </code></pre>
  
  <p>And would like to validate the individual fields, like <code>reminderDate</code> with date validation for example. Is this possible? Note, all of the fields are Strings apart from enabled which is a boolean.</p>