I wasn't proposing changing the validation model at all - but with the advent of Chain we could deprecate the validate(mapping, request) method in favour of a validate(Context) method in ActionForm. This would provide more flexibility and cause less confusion because the method name has stayed the same. I would also suggest that the new validate method shouldn't return anything, with the ActionForm being responsible for sticking the messages in the Context. That way if/when thing move to commons resources we won't face the same problem again.
Niall ----- Original Message ----- From: "Joe Germuska" <[EMAIL PROTECTED]> To: "Niall Pemberton" <[EMAIL PROTECTED]>; "Struts Developers List" <[EMAIL PROTECTED]> Sent: Friday, December 03, 2004 9:09 PM Subject: Re: ActionForm.validateForm(...) to replace ActionForm.validate(...) > At 8:41 PM +0000 12/3/04, Niall Pemberton wrote: > >Wouldn't it be better to get rid of this in 1.3 with the move to Chain? > >Doesn't everything get thrown up in the air and re-defined at that point > >including Action's being deprecated in favour of objects that just implement > >the Command interface? > > I guess I had figured on 1.3 being more transitional than that. But, > even if one were to use a command instead of an action, we haven't > talked (yet) about changing the validation model. > > I haven't heard anyone propose a major change to the model of "Struts > populates an ActionForm and calls a method on it which tests its > validity and is able to return a bundle of messages explaining > validation errors if there are any." My preference would be to defer > any changes that dramatic until 1.4, although with the chain, it > would be a little easier for people to prototype those kinds in the > sandbox or on SourceForge (or whereever...) > > Perhaps it is worth trying to come up with a more future proof > implementation, though. This isn't a burning issue -- clearly people > are confused about the ActionMessages/ActionErrors situation, but I > think that's "under control." By future-proof, I mean something that > passes in the resources-equivalent of ActionMessages, and possibly > which passes in something like a "ValidationContext" which would > eliminate the explicit dependency on HttpServletRequest. > > Joe > > > > >Niall > > > >----- Original Message ----- > >From: "Martin Cooper" <[EMAIL PROTECTED]> > >To: "Struts Developers List" <[EMAIL PROTECTED]> > >Sent: Friday, December 03, 2004 7:59 PM > >Subject: Re: ActionForm.validateForm(...) to replace > >ActionForm.validate(...) > > > > > >> We did just get Commons Resources promoted out of the sandbox, and I'm > >> hopeful that we'll get that puppy released soon. Finally! > >> > >> -- > >> Martin Cooper > >> > >> > >> On Fri, 3 Dec 2004 11:37:38 -0800 (PST), David Graham > >> <[EMAIL PROTECTED]> wrote: > >> > We didn't do it earlier because we wanted to use commons-resources for > >> > message passing. That hasn't happened so we may as well add the > >> > validateForm() method and deprecate validate(). > >> > > >> > David > >> > > >> > > >> > > >> > --- Joe Germuska <[EMAIL PROTECTED]> wrote: > >> > > >> > > In order to push forward on full deprecation of ActionErrors, I > >> > > propose adding the following method to ActionForm: > >> > > > >> > > public ActionMessages validateForm(ActionMapping mapping, > >> > > HttpServletRequest > >request) { > >> > > > >> > > return validate(mapping, request); > >> > > > >> > > } > >> > > > >> > > and then changing one line in the Request Processing chain: > >> > > > >> > > ActionMessages errors = form.validate(mapping, request); > >> > > to > >> > > ActionMessages errors = form.validateForm(mapping, request); > >> > > > >> > > I'm not sure now why we haven't done this earlier. Someone suggested > >> > > it on one of the lists a while ago and it seemed clear once I saw it, > >> > > but I haven't had time to do anything about it. > >> > > > >> > > My inclination is to do this only on the 1.3 (HEAD) branch, and to > >> > > make the change in RequestProcessor.java even though it is slated for > >> > > obsolescence, and then also to make the change in > >> > > o.a.s.chain.AbstractValidateActionForm (which actually still uses > >> > > ActionErrors, actually.) > >> > > > >> > > If it didn't seem strange that it hasn't been done already, I might > >> > > have just gone ahead and done it without raising the question -- so > >> > > I'm wondering if I'm missing something? > >> > > > >> > > Joe > >> > > > >> > > -- > >> > > Joe Germuska > >> > > [EMAIL PROTECTED] > >> > > http://blog.germuska.com > >> > > "Narrow minds are weapons made for mass destruction" -The Ex > >> > > > >> > > --------------------------------------------------------------------- > >> > > To unsubscribe, e-mail: [EMAIL PROTECTED] > >> > > For additional commands, e-mail: [EMAIL PROTECTED] > > > > > > >> > > > >> > > >> > > >> > __________________________________________________ > >> > Do You Yahoo!? > >> > Tired of spam? Yahoo! Mail has the best spam protection around > >> > http://mail.yahoo.com > >> > > >> > > >> > > >> > --------------------------------------------------------------------- > >> > To unsubscribe, e-mail: [EMAIL PROTECTED] > >> > For additional commands, e-mail: [EMAIL PROTECTED] > >> > > >> > > >> > >> --------------------------------------------------------------------- > >> To unsubscribe, e-mail: [EMAIL PROTECTED] > >> For additional commands, e-mail: [EMAIL PROTECTED] > >> > >> > >> > > > > > > > >--------------------------------------------------------------------- > >To unsubscribe, e-mail: [EMAIL PROTECTED] > >For additional commands, e-mail: [EMAIL PROTECTED] > > > -- > Joe Germuska > [EMAIL PROTECTED] > http://blog.germuska.com > "Narrow minds are weapons made for mass destruction" -The Ex > > > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]