public InputSource resolveEntity(String publicID,
String systemID) {
if (systemID != null)
{
String systemFileName = systemID;
if (systemFileName.indexOf("/") > 0)
{
systemFileName = systemFileName.substring(systemFileName.lastIndexOf("/") + 1, systemFileName
.length());
}
ClassLoader classLoader = getClass().getClassLoader();
URL dtdURL = classLoader.getResource("javax/servlet/jsp/resources/" + systemFileName);
if (dtdURL == null)
{
return null;
}
// Return local copy of the dtd
try
{
return new InputSource(dtdURL.openStream());
}
catch (IOException e)
{
// return null
}
}
// If no match, returning null makes process continue normally
return null;
}
|