> -----Original Message----- > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] > Sent: Tuesday, August 24, 2004 10:09 AM > To: Struts Users Mailing List > Subject: RE: HTML:TEXT tag and Internationalization > > > > > > > >>you could format them yourself, either in the setter > (yuck), or in the > action. > > Why not in the setter? Sometimes I'll use the setter to populate some > other fields privately that then get used later on in the > form. Example: I > get a decimal number representing time off the db. The > setter moves left > of the decimal to an hours field and right to a minutes > field. Is this a > bad practice?
I think so... one method one function. The setter should not do anything other then set the variable, because that's what its name implies. A getter on the other hand implies that its going to get something, from somewhere, that has a name. My distaste for setters doing more then one thing is born of way to many hours hunting down bugs that were the result of setter sideeffects. > > > > > > > "Jim Barrows" <[EMAIL PROTECTED]> wrote on 08/24/2004 12:47:04 PM: > > > > > > > > -----Original Message----- > > > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] > > > Sent: Tuesday, August 24, 2004 4:38 AM > > > To: [EMAIL PROTECTED]; [EMAIL PROTECTED] > > > Subject: HTML:TEXT tag and Internationalization > > > > > > > > > Hi > > > > > > Is there any reasonable argument as to why the html:text tag uses > > > default (value.toString()) formating, while the bean:write uses a > > > formatter that is I18N aware. This is really anoying for > locales that > > > normally use comma as a decimal seperator. If you output the > > > value with > > > bean:write it will look OK, but displaying it in an > html:text it will > > > use the English dot as a decimal seperator. I think that > moving the > > > formatValue from WriteTag into TagUtils, hence making it > > > avaiable to all > > > tags would be a good idea. Then we would have a uniform > formatting of > > > values. > > > > Then again, since html:text is usually used with a form bean, which > > is supposed to be all strings, you could format them yourself, > > either in the setter (yuck), or in the action. > > > > > > > --------------------------------------------------------------------- > > 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]