jQuery in Action, 2nd edition*
The moose likes Other Application Frameworks and the fly likes Modular Java: Web Container Modules Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Frameworks » Other Application Frameworks
Bookmark "Modular Java: Web Container Modules" Watch "Modular Java: Web Container Modules" New topic
Author

Modular Java: Web Container Modules

Rainer Eschen
author
Ranch Hand

Joined: Jan 24, 2009
Posts: 75
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?


ICEfaces book . ICEcube . ICEfusion . Scrum
Craig Walls
author
Ranch Hand

Joined: Sep 19, 2003
Posts: 335
    
    5
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.)

Spring in Action - Unleash POJO power in your applications!
Modular Java - Discover the secret weapon to modularity on the Java platform!
XDoclet in Action - Your complete guide to code generation with XDoclet.
Rainer Eschen
author
Ranch Hand

Joined: Jan 24, 2009
Posts: 75
The suggestion not to use many frameworks is a bit difficult ;-). So, you may think it is better to wait for OSGi compatible implementations of the currently used frameworks before it makes sense to refactor?
Craig Walls
author
Ranch Hand

Joined: Sep 19, 2003
Posts: 335
    
    5
Rainer Eschen wrote:The suggestion not to use many frameworks is a bit difficult ;-). So, you may think it is better to wait for OSGi compatible implementations of the currently used frameworks before it makes sense to refactor?


I'm not sure I ever suggested that you shouldn't/couldn't use those frameworks. I just don't know enough about how well JSF and OSGi work together, so I can't make any claims one way or the other.

I'd say it's worthwhile to put together a tracer-bullet project to drive out JSF through OSGi. Nothing fancy...just something to see if it can do what you want it to do. The key thing to watch out for in OSGi is anything that uses classloader trickery. That's because in OSGi, the classloader works a bit different than you'd expect.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Modular Java: Web Container Modules