commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Pretterhofer, Guenter (ext.)" <Guenter.Pretterho...@Dresdner-Bank.com>
Subject AW: [Digester] addSetProperties
Date Wed, 17 Mar 2004 18:20:29 GMT
Hi Martin,

thanks for your answer.

I tried
digester.addSetProperties("/property/database");
instead of
digester.addSetProperties("/property/database", "name", "name");
but the attribute name is still null.

I'm using the follwoing libraries:
commons-digester.jar:	1.5
commons-beanutils.jar:	1.6.1
commons-collections-3.0.jar
commons-logging.jar:	1.0.3
xerces-2.6.2: xml-apis.jar, xercesImpl.jar

Cheers,
Günter


-----Ursprüngliche Nachricht-----
Von: Martin Cooper [mailto:martinc@apache.org]
Gesendet am: Mittwoch, 17. März 2004 18:52
An: Jakarta Commons Users List
Betreff: Re: [Digester] addSetProperties

On Wed, 17 Mar 2004, Pretterhofer, Guenter (ext.) wrote:

> hi all,
>
> maybe somebody can help me with the following problem?
>
> xml-file:
> <property>
> 	<database name="db1">
> 		<user>user1</user>
> 	</database>
> 	<database name="db2">
> 		<user>user2</user>
> 	</database>
> </property>
>
> a small excerpt of the Java source:
> digester.addObjectCreate("property", Property.class);
> digester.addObjectCreate("property/database", Database.class);
> digester.addSetNext("property/database", "addDatabase");
> digester.addSetProperties("/property/database", "name", "name");

Try just:

  digester.addSetProperties("/property/database");

--
Martin Cooper


> digester.addBeanPropertySetter("property/database/user", "user");
>
>
> when i print out name and user the output is the following:
> user=user1
> name=null
> user=user2
> name=null
>
> I don't understand why name is always null ...
> what am I doing wrong?
>
> thanks for your help
> günter
>
>
> ---------------------------------------------------------------------
> 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

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org


Mime
View raw message