BeanUtils.setProperty(...) and null value
843836Jan 28 2004 — edited Jan 28 2004Hi guys!
I have the following problem:
I'm using org.apache.commons.beanutils.BeanUtils setProperty method.
What I want to do is to perform setProperty(myBean, myProperty, null) when user leaves apropriate TextField empty. I get ConversionException.
As I red in API doc "If null is passed into a property expecting a primitive value, then this will be converted as if it were a null string."
What to do when the property expects not primitive value?
My properties are setName(Sring), setSomething(Integer)...
DB also allows nulls.
So, to be short: what is the same of myBean.setName(null) using BeanUtils.setProperty?
Am i stuck?
I'm doing wrong things?
thanks in advance