Return-Path: Delivered-To: apmail-struts-dev-archive@www.apache.org Received: (qmail 94999 invoked from network); 19 Nov 2008 08:26:46 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 19 Nov 2008 08:26:46 -0000 Received: (qmail 73200 invoked by uid 500); 19 Nov 2008 08:26:52 -0000 Delivered-To: apmail-struts-dev-archive@struts.apache.org Received: (qmail 73174 invoked by uid 500); 19 Nov 2008 08:26:52 -0000 Mailing-List: contact dev-help@struts.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Help: List-Post: List-Id: "Struts Developers List" Reply-To: "Struts Developers List" Delivered-To: mailing list dev@struts.apache.org Received: (qmail 73163 invoked by uid 99); 19 Nov 2008 08:26:52 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 19 Nov 2008 00:26:52 -0800 X-ASF-Spam-Status: No, hits=4.0 required=10.0 tests=DNS_FROM_OPENWHOIS,FORGED_YAHOO_RCVD,SPF_HELO_PASS,SPF_PASS,WHOIS_MYPRIVREG X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of lists@nabble.com designates 216.139.236.158 as permitted sender) Received: from [216.139.236.158] (HELO kuber.nabble.com) (216.139.236.158) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 19 Nov 2008 08:25:29 +0000 Received: from isper.nabble.com ([192.168.236.156]) by kuber.nabble.com with esmtp (Exim 4.63) (envelope-from ) id 1L2iO4-0001jY-KL for dev@struts.apache.org; Wed, 19 Nov 2008 00:26:12 -0800 Message-ID: <20575471.post@talk.nabble.com> Date: Wed, 19 Nov 2008 00:26:12 -0800 (PST) From: Sasanka To: dev@struts.apache.org Subject: BeanUtils.copyProperties not working. Pls suggest MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Nabble-From: sasanka_sb@yahoo.com X-Virus-Checked: Checked by ClamAV on apache.org Hi, I am trying to use BeanUtils.copyProperties(dest, source) to automatically populate my model bean from the struts form bean. But it seems the values are not getting copied. I am able to access the value from ActioForm in Struts Action but post BeanUtils.copyProperties I am not able access the values from the Value object. This is my struts-config (partly) : This is my Struts Action : ..... ..... import org.apache.commons.beanutils.BeanUtils; import com.pgwrapper.model.CreditCardVO; public final class CreditCardDataAction extends Action { public ActionForward execute( ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response ) throws IOException //, ServletException { final Category logger = Category.getInstance(com.pgwrapper.handler.CreditCardDataAction.class); ..... ..... DynaValidatorForm creditCardForm = (DynaValidatorForm) form; CreditCardVO creditCard = new CreditCardVO(); try { BeanUtils.copyProperties(creditCard, creditCardForm); } catch (IllegalAccessException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (InvocationTargetException e) { // TODO Auto-generated catch block e.printStackTrace(); } This is my Value Object (partly) : public class CreditCardVO implements java.io.Serializable { final Category logger = Category.getInstance (com.pgwrapper.model.CreditCardVO.class); private String cardtype; private String nameasoncard; private String cardno; private String expmonth; private String expyear; private String suiteno; private String state; private String streetadd; private String zipno; private String city; private String country; public CreditCardVO() { } public String getCardtype() { return this.cardtype; } public void setCardtype(String cardtype) { this.cardtype = cardtype; } .... .... other setter and getter methods .... Pls suggest Thanks Sasanka -- View this message in context: http://www.nabble.com/BeanUtils.copyProperties-not-working.-Pls-suggest-tp20575471p20575471.html Sent from the Struts - Dev mailing list archive at Nabble.com. --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org For additional commands, e-mail: dev-help@struts.apache.org