On Nov 28, 2005, at 1:11 PM, Greg Reddin wrote:
public DigesterDefinitionsReader() {
digester = new Digester();
digester.setValidating(validating);
digester.setNamespaceAware(true);
digester.setUseContextClassLoader(true);
// Register our local copy of the DTDs that we can find
for (int i = 0; i < registrations.length; i += 2) {
URL url = this.getClass().getClassLoader().getResource(
registrations[i+1]);
if (url != null) {
digester.register(registrations[i], url.toString());
}
}
}
The problem is that the ClassLoader cannot resolve the URL if it
begins with "/".
BTW, the Struts version of Tiles does something similar. I remember
seeing something a while back about Apache complaining about too many
requests to the website for the Tiles DTD. The struts-tiles digester
parser class has the following:
digester = new Digester();
digester.setValidating(validating);
digester.setNamespaceAware(true);
digester.setUseContextClassLoader(true);
// 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());
}
No error is logged if url is null. It just doesn't register it and
gets the DTD from the web instead. Could it be that we are always
getting it from the web b/c Tiles never resolves the URL in a web
application?
Greg
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]