Building a Http Service project to host in Apache Karaf
Building web applications only with the Http Service also means a reduction to servlet only services, as Http Service supports only servlets and no further web elements like filters and JSPs. With this reduced set, it is still possible to build modern web applications. For example, it just needs some JavaScript code and a servlet generating JSON to build a modern web application. Using these elements, along with OSGi, you get the perfect mixture for ยต-services. The focus of this recipe, and the following ones, lies only on the usage of the Http Service; so, don't expect to create a fancy web application. After you're through, you will be able to build a single servlet application like the one in the following screenshot:
Getting ready
To precondition the Http Service installed in Apache Karaf, see the Installing Pax modules in Apache Karaf recipe. The sources can be found at https://github.com/jgoodyear/ApacheKarafCookbook/tree/master...