I had a look at Spring OSGi at the early beginning of the project. At that time it was not possible to take a WAR and have a on-the-fly loading of e.g. dedicated "JSF/Facelets components". Is it possible now to realize customer-specific Web components that can be loaded at runtime?
It's now possible to develop Web bundles with Spring DM. As a matter of fact, the framework provides a web extender allowing managing web applications contained in bundles. When the bundle starts, the web application is deployed within the Tomcat or Jetty container present in the OSGi container. Spring DM considers bundles as Web bundles when either a WEB-INF directory or the Web-ContextPath header is present in the MANIFEST file.
We must notice that approach is quite different from HTTP Service and that the actual Web support of Spring DM will be deprecated and replaced by the RFC 66 (OSGi Web Container) support sooner (when specification will be finalized).
Thanks. This really sounds great. Using OSGI is one of the things I'm really interested in. Can't wait for the book to be published. However, does the book explain how to setup tomcat or jetty to work inside an OSGI container?
Yes, of course, the book describes how to setup these Web containers In fact, there is nothing to do for Tomcat 5.5 except putting corresponding bundles within the OSGi container. In addition, for Tomcat 6 and Jetty, you need to define configuration fragment bundles to configure Tomcat 6 (jsp support...) and select Jetty as used Web container (by default, Tomcat is used).
PS: You can notice that the book is already available in a draft version through the MEAP...
Joined: Jan 24, 2009
Hmm. Sounds to me that you talk about embedded Web container(s) and classic Web deployment(s) within a DM environment. My idea is to have a classic Web deployment (Web application) that consists of two or more OSGi bundles. This would allow me to manage a core of "pages" and add or (later skip) some more "pages" dependent on the user who logs in.
I'm not sure if there are technical restrictions in the servlet container concept that don't allow such a modularization.