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

Thomas Diesler thomas.diesler at jboss.com
Tue Nov 1 14:32:43 EDT 2011


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?

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);

cheers
-thomas

-- 
xxxxxxxxxxxxxxxxxxxxxxxxxxxx
Thomas Diesler
JBoss OSGi Lead
JBoss, a division of Red Hat
xxxxxxxxxxxxxxxxxxxxxxxxxxxx



More information about the jboss-as7-dev mailing list