Return-Path: Mailing-List: contact commons-user-help@jakarta.apache.org; run by ezmlm Delivered-To: mailing list commons-user@jakarta.apache.org Received: (qmail 98029 invoked from network); 4 Apr 2003 04:48:11 -0000 Received: from unknown (HELO jktmail05.vico.co.id) (202.155.84.115) by daedalus.apache.org with SMTP; 4 Apr 2003 04:48:11 -0000 Received: from vicomail01.CORP.VICO.CO.ID (192.168.2.3 [192.168.2.3]) by jktmail05.vico.co.id with SMTP (Microsoft Exchange Internet Mail Service Version 5.5.2650.21) id 2C3VD6CK; Fri, 4 Apr 2003 11:38:23 +0700 content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Subject: BeanUtils.copyProperties and null properties X-MimeOLE: Produced By Microsoft Exchange V6.0.4712.0 Date: Fri, 4 Apr 2003 11:48:02 +0700 Message-ID: <3FA9BF42EF84CA439C5AA2B2190590A9036D9DCB@vicomail01> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: BeanUtils.copyProperties and null properties Thread-Index: AcL6ZXrNFGDsOQL2RFCCzh6DHEx1tQ== From: "Budi Rostiarso" To: X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N hi to all, i have a problem which i think is a usual problem, but i cant find the answer in commons forum, so please help :) Here we go: i'm trying to copy properties from Struts' ActionForm to my POJO, and vice versa. All properties from ActionForm are String, as suggested,=20 and most of the properties in my POJO are Float objects, which correspond to db column. My problem is when the user send back the input form, and i use BeanUtils.copyProperties to copy the content of AF to my POJO, all the empty property string turns into default object. For example the from the empty String i get a Float object with value of 0.0, which isn't what i need.=20 (i just need null, so i can update the db column with null value, not 0.0 value). Is this the default behavior of BeanUtils.copyProperties? if its so, how can i get around this? If you need further information, i'll be glad to provide. Thanks in advance Ross.