*/
private ResourceLoader _getResourceLoader(
HttpServletRequest request)
{
final String servletPath = request.getServletPath();
ResourceLoader loader = _loaders.get(servletPath);
if (loader == null)
{
try
{
String key = "META-INF/servlets/resources" +
servletPath +
".resources";
ClassLoader cl = Thread.currentThread().getContextClassLoader();
URL url = cl.getResource(key);
if (url != null)
{
Reader r = new InputStreamReader(url.openStream());
BufferedReader br = new BufferedReader(r);
try
{
String className = br.readLine();
if (className != null)
{
className = className.trim();
Class<?> clazz = cl.loadClass(className);
try
{
Constructor<?> decorator = clazz.getConstructor(_DECORATOR_SIGNATURE);
ServletContext context = getServletContext();
File tempdir = (File)
context.getAttribute("javax.servlet.context.tempdir");
ResourceLoader delegate = new DirectoryResourceLoader(tempdir);
loader = (ResourceLoader)
decorator.newInstance(new Object[]{delegate});
}
catch (InvocationTargetException e)
{