Return-Path: Delivered-To: apmail-jakarta-commons-user-archive@www.apache.org Received: (qmail 6146 invoked from network); 4 May 2007 14:59:30 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 4 May 2007 14:59:30 -0000 Received: (qmail 89377 invoked by uid 500); 4 May 2007 14:59:30 -0000 Delivered-To: apmail-jakarta-commons-user-archive@jakarta.apache.org Received: (qmail 89330 invoked by uid 500); 4 May 2007 14:59:30 -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 89319 invoked by uid 99); 4 May 2007 14:59:30 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 04 May 2007 07:59:30 -0700 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received-SPF: pass (herse.apache.org: local policy) Received: from [135.245.0.39] (HELO ihemail4.lucent.com) (135.245.0.39) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 04 May 2007 07:59:21 -0700 Received: from ilexp01.ndc.lucent.com (h135-3-39-1.lucent.com [135.3.39.1]) by ihemail4.lucent.com (8.13.8/IER-o) with ESMTP id l44EwCAn003193 for ; Fri, 4 May 2007 09:58:56 -0500 (CDT) Received: from DEEXP01.de.lucent.com ([135.248.187.65]) by ilexp01.ndc.lucent.com with Microsoft SMTPSVC(6.0.3790.1830); Fri, 4 May 2007 09:58:38 -0500 Received: from DEEXC1U01.de.lucent.com ([135.248.187.28]) by DEEXP01.de.lucent.com with Microsoft SMTPSVC(6.0.3790.1830); Fri, 4 May 2007 16:58:34 +0200 X-MimeOLE: Produced By Microsoft Exchange V6.5 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Subject: RE: getProperty method for XMLConfiguration - Bug? Date: Fri, 4 May 2007 16:58:34 +0200 Message-ID: <94333A1BF0D2684081652E54E0DE9E98A3160D@DEEXC1U01.de.lucent.com> In-Reply-To: <463A018D.1090103@apache.org> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: getProperty method for XMLConfiguration - Bug? Thread-Index: AceNmPuH1ppBnZ5XSxGBuZ/5S6DvggAw5Liw References: <94333A1BF0D2684081652E54E0DE9E98A31164@DEEXC1U01.de.lucent.com> <463A018D.1090103@apache.org> From: "DECOKER, Lydie \(Lydie\)" To: "Jakarta Commons Users List" X-OriginalArrivalTime: 04 May 2007 14:58:34.0813 (UTC) FILETIME=[B03AD6D0:01C78E5C] X-Scanned-By: MIMEDefang 2.57 on 135.245.2.39 X-Virus-Checked: Checked by ClamAV on apache.org Should not the getProperty works with one or more elements? Lydie=20 -----Original Message----- From: Emmanuel Bourg [mailto:ebourg@apache.org]=20 Sent: Thursday, May 03, 2007 17:37 To: Jakarta Commons Users List Subject: Re: getProperty method for XMLConfiguration - Bug? Hi, Did you try with the getList() method instead ? Emmanuel Bourg DECOKER, Lydie (Lydie) a =E9crit : > Hello, > =20 > I just started to use common configuration package today (version = 1.4). > I am using it to read an XML configuration files. Looking the user=20 > documentation, I used the getProperty method to read the below section = > from XML: > =20 > > > QueueName3 > =09 > myConnectionFactory > > > QueueName4 > =09 > myConnectionFactory > > >=20 > As I do not know the number of IncomingGateway elements, it helps a = lot. > But if I only have one IncomingGateway element, it does not work. >=20 > The way I did it is as follows: >=20 > Object prop =3D config.getProperty(key); if (prop instanceof = Collection)=20 > { > // Get the number of gateways to be defined > int nbGateway =3D ((Collection)prop).size(); > System.out.println("Number of gateway: " + nbGateway); ..... > } >=20 > Did I miss something? >=20 > Regards, >=20 > Lydie >=20 > --------------------------------------------------------------------- > To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org > For additional commands, e-mail: commons-user-help@jakarta.apache.org >=20 --------------------------------------------------------------------- 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