This is actually fixed in 1.5. When I wrote the number type converters orginally I didn't realize that the NumberFormat classes in the JDK will suck a number off the front of a String and not complain! Someone posted a bug with a better way to do this (using NumberFormat and ParsePosition data) to ensure the entire string gets passed.
On the "1,56", depending on what locale you are in I'd say that is a poorly formatted integer. Would you say that "1,000,000" is not an integer? I'm not sure, without writing a lot of checking code, that we could ensure that thosands-separators are only ever used with three-digit groupings... -t On Apr 15, 2008, at 11:13 AM, Mathieu Avoine wrote: > Hi all, > > I noticed that if I enter the value 56xlk9293 in a field bound to > an Integer property, the value gets converted to 56. > The behavior seems incorrect to me, as the string enter contains a > bunch of characters that are not numbers. Also, if I > enter "1,56", it is converted to 156! Needless to say that I'm a > bit surprised: 1,56 is not an integer (could be a float > though), and 56xlk9293 is not even a number, and they both get > converted anyway without a warning. > > I tried to specify @Validate(converter=IntegerTypeConverter.class), > thinking maybe the wrong TypeConverter was used, but > it was the same. > > 1) Is this really the intended behavior? > 2) What do you guys suggest? A custom converter? > > Thanks! > Math > > > ---------------------------------------------------------------------- > --- > This SF.net email is sponsored by the 2008 JavaOne(SM) Conference > Don't miss this year's exciting event. There's still time to save > $100. > Use priority code J8TL2D2. > http://ad.doubleclick.net/clk;198757673;13503038;p?http:// > java.sun.com/javaone > _______________________________________________ > Stripes-users mailing list > [email protected] > https://lists.sourceforge.net/lists/listinfo/stripes-users ------------------------------------------------------------------------- This SF.net email is sponsored by the 2008 JavaOne(SM) Conference Don't miss this year's exciting event. There's still time to save $100. Use priority code J8TL2D2. http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone _______________________________________________ Stripes-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/stripes-users
