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 14271 invoked by uid 98); 17 Jan 2003 16:53:08 -0000 X-Antivirus: nagoya (v4218 created Aug 14 2002) Received: (qmail 14250 invoked from network); 17 Jan 2003 16:53:06 -0000 Received: from daedalus.apache.org (HELO apache.org) (63.251.56.142) by nagoya.betaversion.org with SMTP; 17 Jan 2003 16:53:06 -0000 Received: (qmail 90549 invoked by uid 500); 17 Jan 2003 16:51:43 -0000 Received: (qmail 90541 invoked from network); 17 Jan 2003 16:51:43 -0000 Received: from coral.tci.com (HELO snowmass.tci.com) (198.178.8.81) by daedalus.apache.org with SMTP; 17 Jan 2003 16:51:43 -0000 Received: from mms01-relayb.tci.com (mms01-relayb.broadband.att.com [147.191.90.1]) by snowmass.tci.com (8.12.2/8.12.2) with ESMTP id h0HGpjvY014354 for ; Fri, 17 Jan 2003 09:51:45 -0700 (MST) Received: from 147.191.89.201 by mms01-relaya.tci.com with ESMTP ( Tumbleweed MMS SMTP Relay (MMS v5.5.0)); Fri, 17 Jan 2003 09:51:34 -0600 Received: by entexchimc02.broadband.att.com with Internet Mail Service ( 5.5.2653.19) id ; Fri, 17 Jan 2003 09:51:21 -0700 Message-ID: <41669DC6FE3B80449A33A4DD46DB370A0137BD76@Entcoexch15> From: "Raible, Matt" To: "'Jakarta Commons Users List'" Subject: [beanutils] BeanUtils.copyProperties: POJOs -> Forms Automagicall y Date: Fri, 17 Jan 2003 09:51:09 -0700 MIME-Version: 1.0 X-Mailer: Internet Mail Service (5.5.2653.19) X-WSS-ID: 1236EB1C904495-01-01 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 7bit X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N > The JavaBeans spec defines indexed getters and putters only for things > that pass and return arrays, not Lists. Therefore, this isn't going to > get recognized as a property by the standard introspector. > > Commons-beanutils tries to extend the model so that you can use List-based > properties like this, but looks like it doesn't cover this particular use > case. Could you please post a bug with a small example that illustrates > it? Done. Another question on this same topic. How would I create a custom converter that changes my POJOs into ActionForms? Currently, I do this the (seemingly) hard way: // get HSCRFMaster (with children) from persistence layer HSCRFMasterDAO formDAO = factory.createHSCRFMasterDAO(); HSCRFMaster h = formDAO.getHSCRFMaster(Long.valueOf(form.getId())); // create form for the UI and populate HSCRFMasterForm hscrfForm = new HSCRFMasterForm(); BeanUtils.copyProperties(hscrfForm, h); // loop through the Mux List and use forms instead of POJOs ArrayList muxList = hscrfForm.getMuxs(); for (int i = 0; i < muxList.size(); i++) { HSCRFMux m = (HSCRFMux) muxList.get(i); // create form for the UI and populate HSCRFMuxForm muxForm = new HSCRFMuxForm(); BeanUtils.copyProperties(muxForm, m); muxList.set(i, muxForm); } hscrfForm.setMuxs(muxList); I'd love to have the copyProperties do the work of creating forms for the children. All my ActionForms are generated using XDoclet, so they have the same name as the POJO + the word "Form". Thanks, Matt