Re: Validate length of array

2006-12-07 Thread Niall Pemberton

On 12/5/06, O'Shea, Sean  wrote:

Hi all,

I'm using struts 1.2.7 with commons-validator 1.1.4

I've this DynaValidatorActionForm which has the following properties:






I have the corresponding rules defined:







minlength
3


   maxlength
   20








   minlength
   3


   maxlength
   20





From my understanding, these validations will validate the noOfShares
and fundName properties which are part of the com.myform.Transfer POJO.
In addition to these individual validations I also need to ensure that
the user has entered at least one com.myform.Transfer bean. ie. I need
to make sure that the fundsTransfer array has a size of greater than 1.
Is there a way to include this type of validation in XML format?


What you have looks OK - best way is to try it and see. There isn't a
"minimum indexed/array size validator shipped with any version of
Struts at the moment. You could write a custom one and "configure" it
through the validator's XML. If you do then the best way is to look at
the struts FieldChecks class to see how validators have been
implemented there.

Niall



Hope someone has come across this problem before and can offer some help

Thanks

Sean O Shea


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Validate length of array

2006-12-05 Thread O'Shea, Sean
Hi all,

I'm using struts 1.2.7 with commons-validator 1.1.4

I've this DynaValidatorActionForm which has the following properties:






I have the corresponding rules defined:


 




minlength
3


   maxlength
   20






  

   minlength
   3


   maxlength
   20





>From my understanding, these validations will validate the noOfShares
and fundName properties which are part of the com.myform.Transfer POJO.
In addition to these individual validations I also need to ensure that
the user has entered at least one com.myform.Transfer bean. ie. I need
to make sure that the fundsTransfer array has a size of greater than 1.
Is there a way to include this type of validation in XML format?

Hope someone has come across this problem before and can offer some help

Thanks

Sean O Shea


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]