Good point, and since it's easy for me to add/remove (with XDoclet), it's nice to be aware of this. Personally, I've never used a leading/trailing space on any of my passwords, so I'm not too worried.
Matt -----Original Message----- From: Chappell, Simon P [mailto:[EMAIL PROTECTED] Sent: Wednesday, June 18, 2003 10:48 AM To: Struts Users Mailing List Subject: RE: Is there a reason Struts doesn't trim incoming values? Matt, The only example that I can think of is a password field. On most operating systems (and especially Unix ones) a space is a valid password character and there is no reason why one could not go at the start or finish of a field. As a general web application framework, Struts cannot make judgement calls on what to do with the data that it transfers within action forms. I know that within our application we trim the whitespace from our text inputs, but I would be very upset if Struts did it for me (a user selectable option would be fine) because it has no business making modifications to my data. Simon >-----Original Message----- >From: Raible, Matt [mailto:[EMAIL PROTECTED] >Sent: Wednesday, June 18, 2003 11:37 AM >To: 'Struts Users Mailing List' >Subject: RE: Is there a reason Struts doesn't trim incoming values? > > >I'm just trimming leading and trailing whitespace though - can >you give an >example of a reason I might want to keep leading/trailing whitespace? > >Matt > >-----Original Message----- >From: Chappell, Simon P [mailto:[EMAIL PROTECTED] >Sent: Wednesday, June 18, 2003 10:34 AM >To: Struts Users Mailing List >Subject: RE: Is there a reason Struts doesn't trim incoming values? > > >Not all whitespace is unwanted (just ask a Python geek) so to >trim away all >whitespace out of fields would be a most unwise thing for the >action forms >to do. Such behaviour should be restricted to your interface >objects (those >objects from your system that directly communicate with >Struts) where you >are free to make value judgements on whitespace. > >Simon > >----------------------------------------------------------------- >Simon P. Chappell [EMAIL PROTECTED] >Java Programming Specialist www.landsend.com >Lands' End, Inc. (608) 935-4526 > >"Never give in - never, never, never, never, in nothing great or >small, large or petty, never give in except to convictions of >honor and good sense." - Sir Winston Churchill > > >>-----Original Message----- >>From: Raible, Matt [mailto:[EMAIL PROTECTED] >>Sent: Wednesday, June 18, 2003 11:28 AM >>To: '[EMAIL PROTECTED]' >>Subject: Is there a reason Struts doesn't trim incoming values? >> >> >>I've recently found it necessary to use >>StringUtils.trim(value) on all my >>ActionForm.set() methods. While this is easy for me b/c I use >>XDoclet to >>generate my ActionForms, I'm wondering if this can be an added >>feature to >>Struts. Or should I create a custom StringConverter that >>trims and Struts' >>BeanUtils.copyProperties will use this? >> >>Thanks, >> >>Matt >> >>--------------------------------------------------------------------- >>To unsubscribe, e-mail: [EMAIL PROTECTED] >>For additional commands, e-mail: [EMAIL PROTECTED] >> >> > >--------------------------------------------------------------------- >To unsubscribe, e-mail: [EMAIL PROTECTED] >For additional commands, e-mail: [EMAIL PROTECTED] > >--------------------------------------------------------------------- >To unsubscribe, e-mail: [EMAIL PROTECTED] >For additional commands, e-mail: [EMAIL PROTECTED] > > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]