[jboss-as7-dev] Loading resources through JBWeb context API

Remy Maucherat rmaucher at redhat.com
Wed Nov 2 03:39:39 EDT 2011


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.

> Here is what I do to register the servlet
> 
>              // Add the RegistryServlet
>              servlet = new RegistryServlet();
>              wrapper = context.createWrapper();
>              wrapper.setName("JUDDIRegistryServlet");
>              wrapper.setServlet(servlet);
>              wrapper.setServletClass(servlet.getClass().getName());
>              wrapper.setLoadOnStartup(1);
>              context.addChild(wrapper);

-- 
Remy Maucherat <rmaucher at redhat.com>
Red Hat Inc



More information about the jboss-as7-dev mailing list