org.apache.commons.digester.Digester使用 [待续]

Digester digester = new Digester();
digester.push(this);   //注册摘要的对象
digester.setNamespaceAware(true); //名字空间敏感
digester.setValidating(false);  // 不校验
// Register our local copy of the DTDs that we can find , 注册DTD
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 that we need
//当pattern匹配时的调用方法
digester.addCallMethod("web-app/servlet-mapping", "addServletMapping", 2); 
digester.addCallParam("web-app/servlet-mapping/servlet-name", 0);
digester.addCallParam("web-app/servlet-mapping/url-pattern", 1);
 
 
参考: [url]http://underpersimmon.blog.51cto.com/blog/170743/27859[/url]

你可能感兴趣的:(java,Digester,休闲,"Jakarta,Commons")