Dependency validation in struts validator framework

Discussions

Web tier: servlets, JSP, Web frameworks: Dependency validation in struts validator framework

  1. Hi Can someone help us out in resolving the dependency validation in struts. The scenario is as follows: Example : We have a set of attributes like "DEMAT A/C", "PAN NO", "DATE_OF_BIRTH" Requirement # -1 : 1. When the user enters the "DEMAT A/C" number, the system has to force the user to enter the "PAN NO". How to force the user to enter the "PAN_NO"? Requirement # - 2: 2. When the user enters the "DATE_OF_BIRTH", the system has to force the user to enter the "PAN NO". When the user enters the "DEMAT A/C" number and the "DATE_OF_BIRTH", the validation message to enter the "PAN_NO" gets displayed twice. How can i avoid the duplication of the error messages? (OR) Is there any way, i can avoid the execution of the second requirement when the first requirement's validation message gets fired if he enters both the "DEMAT A/C" and "DATE_OF_BIRTH". Please provide us your input. Thanks in advance Ravi J
  2. Hi Javi, I have written a little open source framework for this kind of holistic validation. It's designed for Spring, but it doesn't require Spring to work, you just forgo the ready built abstractions and spring like configuration in favour of a more traditional approach. You can find it here (http://www.benwilcock.net/downloads.html). You write simple validation classes, but as they are customised to your requirements they can be quite sophisticated. Have a look, see what you think. Ben http://www.benwilcock.net