Return-Path: Delivered-To: apmail-jakarta-commons-user-archive@www.apache.org Received: (qmail 17335 invoked from network); 24 Aug 2006 15:01:51 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 24 Aug 2006 15:01:51 -0000 Received: (qmail 87889 invoked by uid 500); 24 Aug 2006 15:01:47 -0000 Delivered-To: apmail-jakarta-commons-user-archive@jakarta.apache.org Received: (qmail 87537 invoked by uid 500); 24 Aug 2006 15:01:46 -0000 Mailing-List: contact commons-user-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Help: List-Post: List-Id: "Jakarta Commons Users List" Reply-To: "Jakarta Commons Users List" Delivered-To: mailing list commons-user@jakarta.apache.org Received: (qmail 87526 invoked by uid 99); 24 Aug 2006 15:01:46 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 24 Aug 2006 08:01:46 -0700 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: local policy) Received: from [64.52.119.68] (HELO postal.zedak.com) (64.52.119.68) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 24 Aug 2006 08:01:45 -0700 Received: from Jared (unknown [192.168.41.38]) by postal.zedak.com (Postfix) with ESMTP id 4A89713EE6 for ; Thu, 24 Aug 2006 11:03:16 -0400 (EDT) From: "Jared Graber" To: "'Jakarta Commons Users List'" Subject: RE: [commons beanutil] - null, LongConverter, where (or when) should a new converted be registered? Date: Thu, 24 Aug 2006 11:02:24 -0400 Message-ID: <004201c6c78e$4ee064d0$2629a8c0@ad.zedak.com> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable X-Mailer: Microsoft Office Outlook 11 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1807 Thread-Index: AcbBP9n7I3NR6KztRIWI+CqIcK1mqwGSxlzwAACjKPA= In-Reply-To: X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N You need to register your converter at some point before the setProperty = is called. You only need to call it once as it will stay registered unless = you deregister it. Note that this will affect ALL conversions to Long while = it is registered. =20 Someone correct me if I'm wrong, but I don't believe it is thread-safe (though it is classloader safe) so you have to be careful with = registering and deregistering converters. I have only used converters for use with Digester in a web application = so I registered the converters in a servlet context listener. -Jared -----Original Message----- From: German Sibay [mailto:gsibay@hexacta.com]=20 Sent: Thursday, August 24, 2006 10:51 AM To: Jakarta Commons Users List Subject: [commons beanutil] - null, LongConverter, where (or when) = should a new converted be registered? Hi While working with BeanUtils I found that the default LongConverter = converts a null to a Long 0. I needed a null so I wrote my own Converter.=20 The question is where should I put it?=20 I don=B4t really know where is that the converters are initialized the = first time. Must I register this converter every time before using BeanUtils.setProperty? Is Ok if I access beanUtils through a singleton created by my witch registers the converter in the constructor? Where in my application should I register my converter? Thanks! Germ=E1n Sibay. --------------------------------------------------------------------- To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org For additional commands, e-mail: commons-user-help@jakarta.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org For additional commands, e-mail: commons-user-help@jakarta.apache.org