There are quite a few implementations of the OSGi Http Service specification out there. In this chapter, we'll use the one provided by the Felix project. Later, in Chapter 13, Improving the Graphics, we'll also look at the Pax Web implementation as another example.
The Felix project provides a simple, but effective, Http Service implementation. It allows registration of servlets, as well as provides other non-standard features.
The bundles provided are as follows:
Also, for using the host application server in bridged mode (instead of an embedded Jetty), the bundles are:
The "Apache Felix Http Bundle" bundle provides all of the above in a single bundle.
A servlet bridge allows a standard web application container, such as Apache Tomcat, to delegate HTTP requests to another application (in this case, the OSGi framework). Using a container in bridged mode adds the flexibility of using a stable and well-supported container, instead of an Http Service implementation bundle, while still gaining from the flexibility of the OSGi service platform.
For our project, we will use the implementation with embedded Jetty. This will save us the need to install and configure an external web server. We will also use the whiteboard-based registration right away. Let's install those two bundles now, before going on to implementing the servlet bundle.