commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Arjun Ram" <arjun...@myway.com>
Subject Digester Newbie question
Date Thu, 31 Jul 2003 20:34:59 GMT

Hi,

Im trying to load a simple XML file. Here is a sample

<?xml version="1.0"?>
<importtask>
	<database>
		<driver>com.sybase.jdbc2.jdbc.SybDriver</driver>
		<url>jdbc:sybase:Tds:169.69.273.203:10587</url>
		<username>sdssdbo</username>
		<password>sdssdbo</password>
	</database>
	<importsource>
		<tablename>SVHCL</tablename>
	</importsource>
	<importsource>
		<tablename>SVHCL</tablename>
	</importsource>
</importtask>

corresponding code:

digester = new Digester();
digester.addObjectCreate("importtask",
"com.dx.ops.mv.InsertDB");
digester.addCallMethod(
			"importtask/database/driver",
					"setDriver",
					0);

digester.addCallMethod("importtask/database/url", "setUrl", 0);
digester.addCallMethod(
			"importtask/database/username",
					"setUsername",
					0);
digester.addCallMethod(
 		"importtask/database/password",
					"setPasswd",
					0);

digester.addSetNext("importtask/importsource", "addimporttask");

digester.addObjectCreate(
			"importtask/importsource/",
"com.dx.ops.mv.ImportSourceBean");

				digester.addSetProperties("importtask/importsource");
digester.addBeanPropertySetter(
			"importtask/importsource/tablename",
			"tablename");
digester.parse("config.xml");

But addBeanPropertySetter for tablename seems to pick up InsertDB class not the ImportSourceBean.
Am I making a simple mistake some place?

Thanks in advance
Arjun

P.S: its sad to see not many samples for digester

_______________________________________________
No banners. No pop-ups. No kidding.
Introducing My Way - http://www.myway.com

Mime
View raw message