* file format.
*/
protected Digester initDigester(int detail) {
// Initialize a new Digester instance
Digester digester = new Digester();
digester.push(this);
digester.setDebug(detail);
digester.setValidating(validating);
// Register our local copy of the DTDs that we can find
for (int i = 0; i < registrations.length; i += 2) {
URL url = this.getClass().getResource(registrations[i+1]);
if (url != null)
digester.register(registrations[i], url.toString());
}
// Configure the processing rules
digester.addObjectCreate("struts-config/data-sources/data-source",
"org.apache.struts.util.GenericDataSource",
"type");
digester.addSetProperties("struts-config/data-sources/data-source");
digester.addRule("struts-config/data-sources/data-source",
new AddDataSourceRule(digester));
digester.addSetProperty
("struts-config/data-sources/data-source/set-property",
"property", "value");
digester.addObjectCreate("struts-config/action-mappings/action",
mappingClass, "className");
digester.addSetProperties("struts-config/action-mappings/action");
digester.addSetNext("struts-config/action-mappings/action",
"addMapping",
"org.apache.struts.action.ActionMapping");
digester.addSetProperty
("struts-config/action-mappings/action/set-property",
"property", "value");
digester.addObjectCreate
("struts-config/action-mappings/action/forward",
forwardClass, "className");
digester.addSetProperties
("struts-config/action-mappings/action/forward");
digester.addSetNext("struts-config/action-mappings/action/forward",
"addForward",
"org.apache.struts.action.ActionForward");
digester.addSetProperty
("struts-config/action-mappings/action/forward/set-property",
"property", "value");
digester.addObjectCreate("struts-config/form-beans/form-bean",
formBeanClass, "className");
digester.addSetProperties("struts-config/form-beans/form-bean");
digester.addSetNext("struts-config/form-beans/form-bean",
"addFormBean",
"org.apache.struts.action.ActionFormBean");
digester.addSetProperty
("struts-config/form-beans/form-bean/set-property",
"property", "value");
digester.addObjectCreate("struts-config/global-forwards/forward",
forwardClass, "className");
digester.addSetProperties("struts-config/global-forwards/forward");
digester.addSetNext("struts-config/global-forwards/forward",
"addForward",
"org.apache.struts.action.ActionForward");
digester.addSetProperty
("struts-config/global-forwards/forward/set-property",
"property", "value");
return (digester);