You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@commons.apache.org by Syed Ghaznavi <sg...@gmail.com> on 2008/04/05 17:10:11 UTC

Commons Validator Issue with Collections

It's a question regarding commons validator api, wherein i am trying to
validate an input request form (xml-request) which contains a collection of
items...like

<OrdersInputRequest>
  <Order>
     <OrderId>222</OderId>
     <OrderTime>04/04/04</OrderTime>
  </Order>
   <Order>
     <OrderId>223</OderId>
     <OrderTime>04/04/04</OrderTime>
   </Order>
</OrderInputRequest>

What would be the valid format for the commons-validator form to validate
this input request? Since there can be any number of Orders
(java.util.ArrayList) in the request and all the items have the same
validation.
I looked at the examples on the project but couldn't find any solution...

*     <formset>
       <form name="OrdersRequestValidationForm">
          <field property="OrderId" type="Integer" depends="required">
</field>
          <field property="OrderTime" type="String" depends="required">
</field>
       </form>
    </formset> *

Any assistance on this is appreciated..

Thanks!

--Syed Ghaznavi