commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Tatu Vanhanen" <tatu.vanha...@graftor.fi>
Subject RE: [Digester] addSetProperties
Date Thu, 18 Mar 2004 06:31:36 GMT
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