Merge branch '5.1.x'

This commit is contained in:
Juergen Hoeller
2019-03-06 16:26:00 +01:00
6 changed files with 24 additions and 15 deletions

View File

@@ -114,9 +114,18 @@ public class ResourceEntityResolver extends DelegatingEntityResolver {
if (url.startsWith("http:")) {
url = "https:" + url.substring(5);
}
source = new InputSource(url);
source.setPublicId(publicId);
return source;
try {
source = new InputSource(new URL(url).openStream());
source.setPublicId(publicId);
source.setSystemId(systemId);
}
catch (IOException ex) {
if (logger.isDebugEnabled()) {
logger.debug("Could not resolve XML entity [" + systemId + "] through URL [" + url + "]", ex);
}
// Fall back to the parser's default behavior.
source = null;
}
}
}