Posted the following on the Struts User and Struts Dev mailing lists with no
successful reply. Hope someone here can help since this is in common now.
Attached is the datafile. I get no errors, no nothing when this is ran. I
implemented a DTD just to check and turned on validation and it still
doesn't work. Any pointers would be appreciated.
Sean
--
Ok, after spending over 2 hours trying to debug this can I get some eyes on
this please? Does anyone see anything wrong with this method ran against
the attached datafile:
protected void initMappings(InputStream input) {
Digester digester = new Digester();
digester.setDebug(1);
digester.setValidating(false);
digester.push(this);
digester.addObjectCreate("factory-selector/factory",
"com.company.Factory");
digester.addSetProperties("factory-selector/factory");
digester.addSetNext("factory-selector/factory", "addFactory",
"com.company.Factory");
digester.addObjectCreate("*/patternset", "com.company.PatternSet");
digester.addSetProperties("*/patternset");
digester.addSetNext("*/patternset", "addPatternSet",
"com.parlano.web.struts.mapping.PatternSet");
digester.addCallMethod("*/pattern", "addPattern", 0);
try {
digester.parse(input);
}
catch (Exception e) {
System.out.println("DAMN ERRORS");
e.printStackTrace();
}
}
PLEASE, any help would be greatly appreciated ... I can't figure out why
NONE of my objects are getting created nor are they getting populated. No
methods are getting called ...I get no exceptions no nothing ... I put print
statements around things and it is getting through all of this. I also
tried breaking the XML in the datafile and it breaks and errors out so I
know it is parsing the file. ANY help would be appreciated, Thanks ...
Sean
<?xml version="1.0" ?>
<!DOCTYPE factory-selector PUBLIC
"-//Parlano//DTD Factory Selector Configuration 1.0//EN"
"http://www.parlano.com/dtds/factory-selector_1_0.dtd">
<factory-selector>
<factory name="ie" comparator="or">
<pattern-set comparator="and">
<pattern>MSIE</pattern>
<pattern>Windows NT</pattern>
</pattern-set>
<pattern-set comparator="and">
<pattern>MSIE</pattern>
<pattern>Win32</pattern>
</pattern-set>
</factory>
<factory name="default" comparator="or">
<pattern-set comparator="and">
<pattern>Mozilla</pattern>
<pattern>Linux</pattern>
</pattern-set>
<pattern-set comparator="and">
<pattern>Mozilla</pattern>
<pattern>SunOS</pattern>
</pattern-set>
</factory>
<factory name="ns" comparator="and">
<pattern-set comparator="or">
<pattern>Mozilla/5</pattern>
<pattern>Netscape6/</pattern>
<pattern>Mozilla</pattern>
</pattern-set>
</factory>
<factory name="default" comparator="and">
<pattern-set comparator="or">
<pattern>MSPIE</pattern>
<pattern>HandHTTP</pattern>
<pattern>AvantGo</pattern>
<pattern>DoCoMo</pattern>
<pattern>Opera</pattern>
<pattern>Lynx</pattern>
<pattern>Java</pattern>
<pattern>Nokia</pattern>
<pattern>UP</pattern>
<pattern>Wapalizer</pattern>
<pattern>*</pattern>
</pattern-set>
</factory>
</factory-selector>