How can we perform validation for a field which hold three condition. Condition: field1 should be 0 or between 100-200. How can we perform validation for this situation.
posted 8 years ago
Struts validation framework was designed to handle only basic, simple validations. Once you get into more complex scenarios, you generally have to write your own validation logic, either by extending the validate method of your ActionForm (you can still call super.validate() to have the rest of the framework validations performed), or by writing a custom validation rule.
Having said that,you might be able to use the validWhen rule for this. See the section entitled Designing Complex Validations with ValidWhen in this link.