Http Service Extensions

Pax Web extends OSGi Http Service in order to align OSGi web support with latest developments of Servlet specs.

In order to make use of this extensions you will have to get hold of a WebContainer service instead of HttpService as in:

bundleContext.getServiceReference( "org.ops4j.pax.web.service.WebContainer" );

Having an WebContainer service instance you will be able to dynamically:

Accessing the BundleContext

The BundleContext is exposed as attribute of the ServletContext:

BundleContext ctx = (BundleContext) servletContext.getAttribute(