Building a Http Service with the Whiteboard pattern in Apache Karaf

The Whiteboard pattern is a much easier approach to registering servlets, resources, JSPs, or filters. With the Whiteboard extender, the registration of services works in the opposite way to the last recipe. The bundle activator doesn't wait for the Http Service to show up; it just registers the servlets and the other resources as services while the Whiteboard extender picks up those services and makes sure that everything is ready to be served. With the Whiteboard feature, it is possible to use all web technologies available to the underlying Jetty server, as we are not bound to the restricted Http Service interface anymore. This recipe will guide you through this by using two ...

Get Apache Karaf Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.