Just wanted to add that if you have a List property and you are not using indexed properties, you can use @Validate(required=true) to validate that the list has at least one item. If you're using indexed properties, you'll have to use a validation method like Tim explained.
The other thing to understand is that validations are not executed if no value is submitted (other than required=true). So you can have all the validations you want, "1 == 0", "5 > 0", maxvalue=-1, whatever, but if the field is left blank, those validations will not be executed. This is normal: if your field doesn't have required=true, then it is optional. No error should occur if an optional field is left blank. If a value /is/ submitted, then all validations will be executed. Cheers, Freddy - You know, the more I think about this, the more I think we've all - been barking up the wrong tree. When you have lists in your action - bean (or domain model) the validations are applied individually to - each element of the list as it gets bound. So the expression would - be evaluated against each item being put into the list. And - expression validation is only run /if/ there is a value to run it on. - - So in short, I don't think this can be done with expression - validation. You'll have to resort to a validation method I think. - - -t ------------------------------------------------------------------------- Check out the new SourceForge.net Marketplace. It's the best place to buy or sell services for just about anything Open Source. http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace _______________________________________________ Stripes-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/stripes-users
