Rainer Eschen wrote:For us the most interesting thing with OSGi is to have a modular Web container application that allows to manage also JSF pages/backing beans as loadable modules. I read in the past that this will be possible with Spring in the future. Can we use this already in production? What do we have to keep in mind when we refactor a Spring based Web application with JSF frontend for this?
Honestly, I'm not much of a JSF expert and I've never done JSF in the context of OSGi. So, I'm not sure I'm qualified to answer this particular question.
That said, there is a lot of working being done in the area of formalizing how we do webapps in OSGi. There are already a handful of ways to do this (I cover one such way in the book that supports
JSP). But OSGi R4.2 includes a specification for web bundles that formalizes how to develop web applications in OSGi. SpringSource is providing the RI for that part of the spec and is retrofitting their dm Server to be based on it.
The one thing I'd keep in mind when developing web bundles (no matter how you do it) is to keep your WEB-INF/lib as empty as possible and your WEB-INF/classes as focused on web-stuff as possible. Instead of depending on libraries in WEB-INF/lib, your web bundle should depend on packages and services exposed by other bundles in the OSGi framework. Aside from that, building a web bundle isn't much different than building a regular WAR file. (Again, I'm not sure if JSF presents any special challenges in this regard.)