From: <jue...@we...> - 2003-07-31 20:14:54
|
Hi Alef, That sounds interesting, and it should be pretty easy to integrate. But = for the sake of getting 0.9.1 out ASAP, I suggest to hold it back for = after the release, just like the Tiles integration. I guess we will = release a 0.9.2 follow-up at end of August anyway, all that stuff should = fit in there in polished and tested versions. BTW, I really like the extensive Javadoc that you added to some of the = web controller classes, especially the explanations of the workflows! = Very, very welcome :-) Juergen -----Original Message----- From: Alef Arendsen (JTeam) [mailto:al...@jt...] Sent: Wednesday, July 30, 2003 1:55 PM To: spr...@li... Subject: [Springframework-developer] Using PropertyEditors in JSPs Everyone,=20 I've made an addition to the BindStatus and BindTag and added a = TransformTag (the name is still open for discussion) I wanted to discuss = with you before adding it. When using <spring:bind>, a BindStatus object is instantiated for the = path (on the command class) I'm setting in the tag. Also, any = PropertyEditors that are associated to that field or type of property = are consulted to get the appropriate String representation for the = property. However, right now it's not possible to also retrieve String = representations for any referenceData I've bound in the requestContext. Consider the following:=20 * I want to add a user and the user has a property called language = (preferred language, with associated getLocale() and setLocale() = methods)=20 * Using a formcontroller I've returned the formBackingObject as well as = some referenceData (in this case, a list of Locale objects from which = the user wants to choose)=20 * To be able to let the user choose one of the locale objects and let = the framework set the right locale using the associated LocaleEditor, I = need to be able to make consult the LocaleEditor for the locales in the = list as well=20 I thought of the following to make this work. Everything enclosed by = <spring:bind>-tags applies to a certain path of the command object and = therefore (if applicable) an associated PropertyEditor. So anything = enclosed by those tags could be rendered using that specific = PropertyEditor as well. The attached example shows the final JSP used to implement the above = usecase.=20 Modification that need to be made to add this functionality are the = following:=20 * getCustomerEditor()-method to BindTag and Errors interface (and = corresponding implementations in BindException and EscapedErrors = (returning the appropriate editor or null if not applicable or not = found)=20 * Addition of transform-tag to be used inside bindtag=20 The only thing I'm not sure about is the first modification...=20 Any comments, objections or remarks about the implementation?=20 Alef=20 <<...>>=20 =3D=3D=20 JTeam B.V.=20 Donker Curtiusstraat 7-412=20 1051 JL Amsterdam=20 T: +31 20 486 20 36=20 M: +31 6 24 11 1996=20 F: +31 84 837 00 00=20 E: al...@jt...=20 W: <file://www.jteam.nl> www.jteam.nl=20 |