Ok, Martin's initiative has made me dig up the link to my original PropertyEditor rant. :)
http://www.mail-archive.com/[email protected]/msg02111.html It's also in the search results on the message he links to, but it's on the second or third page. That's the thread that I think Martin is referring to. -Paul Speed Martin Cooper wrote: > > The Struts PropertyUtils class is deprecated because it was moved to the > Commons project: > > http://jakarta.apache.org/commons/beanutils.html > > Regarding PropertyEditors, you can read my take on them, and the thread on > which my take is based, starting here: > > http://www.mail-archive.com/[email protected]/msg03680.html > > -- > Martin Cooper > > ----- Original Message ----- > From: <[EMAIL PROTECTED]> > To: "'Struts Developers List'" <[EMAIL PROTECTED]> > Sent: Wednesday, February 20, 2002 5:31 AM > Subject: PropertyUtils with added PropertyEditor support > > > Hello. > > > > > > [In short] > > > > The (deprecated) PropertyUtils class doesn't seem to support > PropertyEditors > > at all. I had to modify the class to fit my purposes, by adding this > > support. For example, when trying to set a String into a property which > is > > not a String type, I check with the PropertyEditorManager for a > > corresponding editor, and try to use it for converting types. > > > > However, I'm a little worried because, first PropertyUtils is deprecated, > > second I had to modify and maintain my own version of the class (which > > overrides the one in the Struts jar). > > > > > > [My question] > > > > Should my modifications be included into cvs, or is there a cleaner way of > > achieving this kind of custom conversion? > > > > > > [More details] > > > > The reason for this need is that I'm using Torque and Torque's > > primary/foreign keys are in the form of NumberKey objects, which can be > > constructed from a String, or converted toString(). Obviously, at some > > point keys need to be as Strings (for the html form and parameters), and > at > > some other point as NumberKeys. I decided to make my Form Bean mimick the > > OM Bean by defining both of them with NumberKey properties, in order to > ease > > their implementation. This way the conversion must occur within Struts, > > when it tries to populate or read the Form Bean, which is performed with > the > > help of PropertyUtils. The PropertyEditor support did the trick for that. > > > > > > Any suggestions would be greatly appreciated... > > > > Best regards, > > > > -- Mathieu > > > > > > -- > > To unsubscribe, e-mail: > <mailto:[EMAIL PROTECTED]> > > For additional commands, e-mail: > <mailto:[EMAIL PROTECTED]> > > > > -- > To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> > For additional commands, e-mail: <mailto:[EMAIL PROTECTED]> -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
