Hello,
Seems that the LongCustomEditor doesn't convert correct strings to long when the string passed have a blank character.
I think that is not he correct behaviour and the string has to be trimmed before trying to convert to long.
I think i can extend the editor form spring an register the editor to achieve the desired effect but i think this is a thing that has to do the core project of spring.
Thank you for your time.
exception:
------------
nested exception is
org.springframework.beans.PropertyAccessExceptions Exception:
PropertyAccessExceptionsException (1 errors); nested propertyAccessExceptions
are: [org.springframework.beans.TypeMismatchException: Failed to convert
property value of type [java.lang.String] to required type [long] for
property 'repeatInterval'; nested exception is
java.lang.NumberFormatException: For input string: "30000 "]
PropertyAccessExceptionsException (1 errors)
org.springframework.beans.TypeMismatchException: Failed to convert property
value of type [java.lang.String] to required type [long] for
property 'repeatInterval'; nested exception is
java.lang.NumberFormatException: For input string: "30000 "
java.lang.NumberFormatException: For input string: "30000 "
at java.lang.NumberFormatException.forInputString
(NumberFormatException.java:48)
at java.lang.Long.parseLong(Long.java:403)
at java.lang.Long.valueOf(Long.java:509)
at sun.beans.editors.LongEditor.setAsText(LongEditor. java:24)
at
org.springframework.beans.BeanWrapperImpl.doTypeCo nversionIfNecessary
(BeanWrapperImpl.java:962)
at org.springframework.beans.BeanWrapperImpl.setPrope rtyValue
(BeanWrapperImpl.java:778)
at org.springframework.beans.BeanWrapperImpl.setPrope rtyValue
(BeanWrapperImpl.java:684)
at org.springframework.beans.BeanWrapperImpl.setPrope rtyValue
(BeanWrapperImpl.java:825)
at org.springframework.beans.BeanWrapperImpl.setPrope rtyValues
(BeanWrapperImpl.java:852)
at org.springframework.beans.BeanWrapperImpl.setPrope rtyValues
(BeanWrapperImpl.java:841)
at
org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.ap
plyPropertyValues(AbstractAutowireCapableBeanFacto ry.java:863)


Reply With Quote