> -----Original Message----- > From: Steve Wilkinson [mailto:[EMAIL PROTECTED]] > Sent: Wednesday, September 25, 2002 2:00 PM > To: 'Jakarta Commons Developers List' > Subject: RE: Design question on BeanUtils.populate() > > > Please don't take my question the wrong way, I'm not trying > to start a flame war here.
I didn't mean for that to come off like a flame; it was a sincere question. :-) > I'm just saying the specification > says that it's not to set the attribute on the bean if there > is an empty string retrieved from the request. > > RE: How would you set something to an empty string, then? > Why would you need to set it to an empty string? Doesn't an > empty string represent no input, just as leaving the > attribute to it's initalized value? But a) some beans might not initialize their properties to the empty string, b) this can be used on existing beans that have had their properties set to non-empty values at some point. > > > I'm just asking if anyone realized that the specification > operates differently and if there are plans to change this > implementaiton. My conclusion from reading the specification > and from seeing the implementation of BeanUtils.populate() > that this method does not operate in the spirit of the > <jsp:setProperty> tag that's built into the JSP > specification. If this is the case, could we add something > in the JavaDoc to indicate it as such? That's probably a good idea. The BeanUtils class was originally written for Struts, and not to implement the jsp:setProperty spec. I know that my particular Struts app relies on the fact that empty request values cause the form properties to be set to the empty string. I'm sure that many others do too. -- Tim Moore / Blackboard Inc. / Software Engineer 1899 L Street, NW / 5th Floor / Washington, DC 20036 Phone 202-463-4860 ext. 258 / Fax 202-463-4863 -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>