Building an application with custom HttpContext with Apache Karaf

All previous recipes have covered how to register servlets and filters, and all from within the same bundle bound to a default HttpContext. If no other HttpContext is defined, DefaultHttpContext is created while registering a servlet or resource. With this recipe, we will work with a custom HttpContext.

Getting ready

As this recipe is a specialization of the previous recipes, you'll find the source code for it in the Building a Http Service with the Whiteboard pattern in Apache Karaf recipe. As usual, the recipe demands the successful installation of the http-whiteboard feature; how this can be achieved is explained in the Installing extended Http Service in Apache Karaf recipe. The ...

Get Apache Karaf Cookbook now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.