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 Thu, 18 Mar 2004 15:35:16 GMT
Tatu,

thanks for your answer.
As far as I can see there is a setName method in the Database class.

Attached is a simplified code example where the attribute name is not set.

thank u
Günter



-----Ursprüngliche Nachricht-----
Von: Tatu Vanhanen [mailto:tatu.vanhanen@graftor.fi]
Gesendet am: Donnerstag, 18. März 2004 07:32
An: Jakarta Commons Users List
Betreff: RE: [Digester] addSetProperties

Check that the Database class has a valid bean setter method for the "name"
property, i.e.
"public void setName(String name)".

- Tatu V.

> -----Original Message-----
> From: Pretterhofer, Guenter (ext.)
> [mailto:Guenter.Pretterhofer@Dresdner-Bank.com]
> Sent: 17. maaliskuuta 2004 17:08
> To: commons-user@jakarta.apache.org
> Subject: [Digester] addSetProperties
>
>
> 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");
> 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



Mime
View raw message