Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

BeanUtils.setProperty(...) and null value

843836Jan 28 2004 — edited Jan 28 2004
Hi 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
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Feb 25 2004
Added on Jan 28 2004
1 comment
1,059 views