velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Nathan Bubna" <>
Subject Re: ClassLoader resource loading of templates, for the record (and perhaps for the next release?)
Date Thu, 14 Aug 2003 04:45:40 GMT
Nutter, Charles O. said:
> (Sorry if this sort of thing should be posted to -dev, but I wanted to toss
it out for comments first :)

tossing it out here for comments is fine.  but, yeah, velocity-dev and/or
bugzilla are where this discussion needs to end up if you want to up your
chances of developer attention.

> I managed to create a resource loader that does what I need to.

great!  others may have similar needs; hopefully you'll share?

> I see the following problems with ClasspathResourceLoader:
> The fix is terribly simple, and I think it makes sense to apply it directly
> to ClasspathResourceLoader, or at least provide a
> ThreadContextResourceLoader, as I have done:
> In ClasspathResourceLoader.getResourceStream(), change:
> ClassLoader classLoader = this.getClass().getClassLoader();
> to:
> ClassLoader classLoader = Thread.currentThread().getContextClassLoader();

+1   my understanding is that this is the proper way for such things.

> Comments? Questions? Flames? What do I have to do to convince
> the Velocity guys this needs to go in? :)

very thorough post.  your proposed change sounds good to me.  but if you want
the Velocity committers to implement it, you'll at the least need to make some
noise like this on the dev list.  also, please submit this as a bug report in
bugzilla (probably as a minor bug, not an enhancement).  and if you want to up
the bug's chances of getting attention soon, create a patch for
ClasspathResourceLoader (be sure you've tested it), and add "PatchAvailable"
to the keywords for the bug report.

Nathan Bubna

View raw message