commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mikko Nylén <>
Subject Digester: Problem with CallMethodRule
Date Mon, 05 Sep 2005 04:18:53 GMT

I'm having a little problem with Digester's CallMethodRule: it doesn't 
call the method.

The XML file I try to parse is:

    <page path="/index.htm" class="test.TestPage" />
    <page path="/hello.htm" class="test.HelloPage" />

The Java code I'm trying to use for parsing the configuration:

Digester digester = new Digester();
digester.addObjectCreate("configuration", "test.Configuration");
digester.addSetProperties("configuration/pages/page", new 
String[]{"path", "class"}, new String[]{"path", "className"});
digester.addCallMethod("configuration/pages/page", "freeze");
digester.addSetNext("configuration/pages/page", "addPageConfiguration", 

Configuration configuration = (Configuration)digester.parse(reader);

The problem is that the freeze() method of instantiated 
PageConfiguration objects isn't ever called (which results to that the 
Configuration's addPageConfiguration(PageConfiguration) throws an 
IllegalStateException). How I should fix this? I'm using the version 1.7 
of Digester.

- Mikko Nylén

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message