Return-Path: Delivered-To: apmail-jakarta-commons-dev-archive@www.apache.org Received: (qmail 21022 invoked from network); 3 Jun 2007 08:30:38 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 3 Jun 2007 08:30:38 -0000 Received: (qmail 43459 invoked by uid 500); 3 Jun 2007 08:30:40 -0000 Delivered-To: apmail-jakarta-commons-dev-archive@jakarta.apache.org Received: (qmail 43386 invoked by uid 500); 3 Jun 2007 08:30:40 -0000 Mailing-List: contact commons-dev-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Help: List-Post: List-Id: "Jakarta Commons Developers List" Reply-To: "Jakarta Commons Developers List" Delivered-To: mailing list commons-dev@jakarta.apache.org Received: (qmail 43375 invoked by uid 99); 3 Jun 2007 08:30:40 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 03 Jun 2007 01:30:40 -0700 X-ASF-Spam-Status: No, hits=-100.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO brutus.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 03 Jun 2007 01:30:36 -0700 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id C497F714062 for ; Sun, 3 Jun 2007 01:30:15 -0700 (PDT) Message-ID: <27749576.1180859415802.JavaMail.jira@brutus> Date: Sun, 3 Jun 2007 01:30:15 -0700 (PDT) From: "Baptiste MATHUS (JIRA)" To: commons-dev@jakarta.apache.org Subject: [jira] Commented: (BEANUTILS-175) [beanutils] Handling of exceptions thrown during BeanUtils.populate MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/BEANUTILS-175?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12501005 ] Baptiste MATHUS commented on BEANUTILS-175: ------------------------------------------- To answer (well, four years later... :)) about it: I think this class could in fact be added for the best of both worlds: the PropertyUtilsBean class would use the default ExceptionHandler implementation that would behave exactly like now, and other implementations could just return null if wanted when accessing say "a.b" with a being null. > [beanutils] Handling of exceptions thrown during BeanUtils.populate > ------------------------------------------------------------------- > > Key: BEANUTILS-175 > URL: https://issues.apache.org/jira/browse/BEANUTILS-175 > Project: Commons BeanUtils > Issue Type: Improvement > Components: Bean / Property Utils > Environment: Operating System: All > Platform: All > Reporter: Eric Pabst > Priority: Minor > Fix For: LATER THAN 1.8.0 > > > I run into a problem when using Struts to populate request parameters to a > form's nested property when either the conversion from String to int (for > example) fails or when the set method in the nested bean throws an exception > such as IllegalArgumentException. > I propose that we add a property to BeanUtilsBean for a new interface called > something like PopulateExceptionHandler which will have a method something like > void execute(Exception exception, Object bean, String propertyPath, Object > value) > Then, within BeanUtilsBean.populate, within the loop, it would catch any > exception, and call the populateExceptionHandler's execute method with it > (unwrapping InvocationTargetException's). The default handler would just > rethrow it (or we could have no default handler, and if no handler is present, > the BeanUtils method rethrows it). -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online. --------------------------------------------------------------------- To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org For additional commands, e-mail: commons-dev-help@jakarta.apache.org