|
From: Jean-Pierre <jp...@jp...> - 2003-08-20 17:45:27
|
Looked at code, it seems it's done this way. Better, the whole collection of Exceptions is thrown. So normally, all the bounds are currently done. Jean-Pierre -----Message d'origine----- De=A0: spr...@li... [mailto:spr...@li...] De la part de jp....@ti... Envoy=E9=A0: mercredi 20 ao=FBt 2003 18:14 =C0=A0: kk Cc=A0: juergen.hoeller; springframework-developer Objet=A0: [Springframework-developer] Re: [Springframework-developer] = Tags Ken, You highlight a second issue (remainings bindings). The first was due in my case as you could see by the use of nested properties. The best way for this second issue would be, I think, to rewrite the BeanWrapperImpl in order to catch and store exceptions during the binding and then rethrow the first one when all bindings are done. Jean-Pierre ---------- Initial Header ----------- From : Ken Krebs <kk...@kk...> To : "jp....@ti..." <jp....@ti...> Cc : "j=FCrgen h=F6ller = [werk3AT]"<jue...@we...>, 'spring-dev-list' <spr...@li...> Date : Wed, 20 Aug 2003 10:43:29 -0500 Subject : Re: [Springframework-developer] Tags JP, Petclinic shows an example of this on the add/edit Pet forms and the=20 addVisit form. Look at the messages.properties for the typeMismatch=20 messages. I got a reply from Juergen when I queried about this situation (sent on=20 17-JUN). See my original message and the reply below. As to keeping the data intact, your FormController should set the=20 sessionForm property to true. In petclinic, this is done in the=20 constructor. The date editor is setup in AbstractClinicForm.initBinder(). There is a problem with this technique in that this process will retain=20 the bad date data that was entered but not other subsequent data on the=20 form as it seems to short circuit the rest of the binding process. Try=20 entering something in the Description field on the addVisit form. Then=20 enter a bad date, submit and see what happens. Perhaps I'm not doing it=20 quite right ?? Initially, I tried to work around the ugly stacktrace message I was=20 getting by creating my own date editor and trapping the ParseException=20 and setting the field to null, thereby handing it off to the validator.=20 Ideally, it would be nice if the custom editor would participate in the=20 same way as validators do, IMO. Regards, Ken |