Can anyone who knows the history of WebappClassLoader explain why
WebappClassLoader overrides getResourceAsStream() in the first place
instead of inheritting the implementation that exists in ClassLoader,
which looks like this:
// ClassLoader.java
public InputStream getResourceAsStream(String name) {
URL url = getResource(name);
try {
return url != null ? url.openStream() : null;
} catch (IOException e) {
return null;
}
}
Not only does WebappClassLoader reimplement getResourceAsStream(), it in
fact duplicates the entire resource lookup logic instead of delegating
to getResource() implementation.
Sahoo