You have a model class in your action to populate, one of the property is a java.util.Date. You register your own DateConverter (for i18n purpose ...) When WW2 populates the Action after a form submission, you have 2 cases : 1/ The string represent a date, and the converter can parse it and store it in the model class. No pb. 2/ The string doesn't represent a date, your converter surely returns a NULL value. The date property in the model class is set to NULL. You can always validate that the property MUST be not null, but the main aim is to warn the user it is an invalid date.
So my question is : if validation triggers after populating the model class, how can you validate an input parameter is not in a bad format ? Cheers. Richard -----Message d'origine----- De : [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] la part de Jason Carreira Envoye : jeudi 25 septembre 2003 18:44 A : [EMAIL PROTECTED] Objet : RE: [OS-webwork] Validation Framework details > -----Original Message----- > From: Fred Lamuette [mailto:[EMAIL PROTECTED] > Sent: Thursday, September 25, 2003 5:23 AM > To: [EMAIL PROTECTED] > Subject: RE: [OS-webwork] Validation Framework details > > > That was my idea in one of my previous post, but finally I > think it's not a so good idea. Multiply the levels of control > is a danger that can make the validation framework not so > easy to use. Why not just add support to the converters that > could do the job, merely in dealing with the errors that > could be generated by converters. Converting a string to a > date could generate an error from the converter, and so > managed by the validation framework. > > 1/ Populating the bean > HTTP Input Parameters ----converters at work------> Bean > populated in Action class > > If converters can't convert, a null value is set and an error > could be stored in order to be used by the validation framework > > 2/ Validation of the bean > - Extract errors from converters > - Execute the validation from conf files ...-conversion.xml > > Richard. > What do you mean by the Validators using the errors? The validators just validate the properties. Jason ------------------------------------------------------- This sf.net email is sponsored by:ThinkGeek Welcome to geek heaven. http://thinkgeek.com/sf _______________________________________________ Opensymphony-webwork mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/opensymphony-webwork ------------------------------------------------------- This sf.net email is sponsored by:ThinkGeek Welcome to geek heaven. http://thinkgeek.com/sf _______________________________________________ Opensymphony-webwork mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/opensymphony-webwork