[jboss-as7-dev] Loading resources through JBWeb context API
Jason T. Greene
jason.greene at redhat.com
Wed Nov 2 14:00:34 EDT 2011
On 11/2/11 2:39 AM, Remy Maucherat wrote:
> On Tue, 2011-11-01 at 18:32 +0000, Thomas Diesler wrote:
>> Hi Remy,
>>
>> I have a 3rd party servlet that uses this API
>>
>> InputStream is = getServletContext().getResourceAsStream(propFile);
>>
>> How is it possible to hook into this call using the dynamic context API?
>
> You cannot replace the servlet context implementation.
Thomas are you asking how to get the context to see the right resources?
You can do:
final Loader loader = new
WebCtxLoader(ThirdPartyClass.getClassLoader());
...
context.setLoader(loader);
--
Jason T. Greene
JBoss AS Lead / EAP Platform Architect
JBoss, a division of Red Hat
More information about the jboss-as7-dev
mailing list