Chapter 8. Developing OSGi web components with Spring DM and web frameworks

 

This chapter covers

  • Using Spring DM in a web environment
  • Integrating Spring DM with different kinds of web frameworks (action-based, component-driven, AJAX, web services)
  • Taking advantage of Spring support for these frameworks to make using Spring DM simple

In the previous chapter, we described how to use data access technologies such as JDBC and JPA with Spring DM to handle data for non-OSGi applications. In this chapter, we’ll focus on another aspect of enterprise applications: developing web components. Although Java EE provides servlets and JSPs (JavaServer Pages) to address these issues, using them on their own is generally considered tricky. One solution is to use a dedicated framework that leverages the Model-View-Controller (MVC) pattern. When implementing web bundles with Spring DM, these issues—and their solutions—are largely unchanged. The key is knowing how to use web frameworks in an OSGI environment and how to integrate them with Spring DM.

In the following sections we’ll describe how to integrate Spring DM with various web technologies and frameworks to create web UIs or expose web services. We’ll describe each in the context of the framework family they belong to:

  • Action-based web frameworks
  • Component-driven frameworks
  • AJAX-based frameworks
  • Web services

For each, we’ll explain how to optimize their integration with Spring DM. Let’s get started!

8.1. Using action-based web frameworks with Spring DM

8.2. Using component-based web frameworks with Spring DM

8.3. Using AJAX frameworks with Spring DM

8.4. Using web services with Spring DM

8.5. Summary