|
From: Erwin V. <erw...@er...> - 2005-03-11 19:03:30
|
There are several Errors objects related to the same target bean. A use case could be: 1) BindException created by controller => this is the BindException which has all the correct property editors associated with it 2) input validation runs with no errors => BindException remains empty 3) onSubmit() invokes business method which generates business exception 4) onSubmit wants to merge the business exceptions into the existing errors object, to ease this, the business exception hierarchy provides a "toErrors()" method (which could be specific for each kind of business exception). Currently step 4 is a pain in the butt since the controller needs to extract the info from the business exception and start calling errors.reject(...). A typical case where you would have this is when the business layer does additional input validation that cannot easily be moved out of a transactional context. Erwin Vervaet erw...@er... ----- Original Message ----- From: "Seth Ladd" <set...@gm...> To: <spr...@li...> Sent: Friday, March 11, 2005 7:41 PM Subject: Re: [Springframework-developer] BindException > On Fri, 11 Mar 2005 19:22:31 +0100, Erwin Vervaet > <erw...@er...> wrote: >> All, >> >> I was wondering whether we can make the >> BindException.addError(ObjectError >> error) method public? It is currently protected. The other option would >> be >> to add a public BindException.addAllErrors(Errors errors) method. >> Doing this will make it easy to merge several Errors objects and expose >> them >> as one object to the view. > > > Are the multiple different Errors objects from different target beans? > I think there's a one to one relationship between a Bean and its > Errors object (since the Errors object wraps a bean). So combining > multiple Errors objects into a single Errors might not make sense. > What is the use case here? > > Seth > > > -- > <a href="http://www.picklematrix.net/foaf.rdf">Seth Ladd's FOAF</a> > <a href="http://www.foaf-project.org/">What is FOAF?</a> > > > ------------------------------------------------------- > SF email is sponsored by - The IT Product Guide > Read honest & candid reviews on hundreds of IT Products from real users. > Discover which products truly live up to the hype. Start reading now. > http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click > _______________________________________________ > Springframework-developer mailing list > Spr...@li... > https://lists.sourceforge.net/lists/listinfo/springframework-developer > > |