in velocity-tools-view/src/main/java/org/apache/velocity/tools/view/ServletUtils.java [348:388]
public static URL getURL(final String path, final ServletContext application)
{
URL url = null;
if (!isWebappResource(path))
{
// search classpath except for WEB-INF/*
url = ClassUtils.getResource(path, ServletUtils.class);
}
else
{
// then webapp only for WEB-INF/*
if (System.getSecurityManager() != null)
{
url = AccessController.doPrivileged(
new PrivilegedAction<URL>()
{
@Override
public URL run()
{
try
{
return application.getResource(path);
}
catch (MalformedURLException mue)
{
return null;
}
}
});
}
else
{
try
{
url = application.getResource(path);
}
catch (MalformedURLException mue) {}
}
}
return url;
}