GeeCON Prague 2014*
The moose likes Spring and the fly likes Spring DM for Web Applications Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Frameworks » Spring
Bookmark "Spring DM for Web Applications" Watch "Spring DM for Web Applications" New topic
Author

Spring DM for Web Applications

Rainer Eschen
author
Ranch Hand

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


ICEfaces book . ICEcube . ICEfusion . Scrum
Thierry Templier
author
Greenhorn

Joined: Jan 26, 2010
Posts: 15
Hello Rainer,

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).

Regarding the use JSF within an OSGi container, we made it work with Myfaces 1.2.2 after fixing a small issue (see http://issues.apache.org/jira/browse/MYFACES-2442). You can find a complete working sample in code source of the "Spring DM in action" book at the following url: http://code.google.com/p/springdm-in-action/source/browse/#svn/trunk/ch08/ch08-web-jsf-myfaces

Hope it answers to your question!
Thierry
Alaa Nassef
Ranch Hand

Joined: Jan 28, 2008
Posts: 467
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?


Visit my blog: http://jnassef.blogspot.com/
Thierry Templier
author
Greenhorn

Joined: Jan 26, 2010
Posts: 15
Hello Alaa,

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).

Thierry
PS: You can notice that the book is already available in a draft version through the MEAP...
Rainer Eschen
author
Ranch Hand

Joined: Jan 24, 2009
Posts: 75
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.
Thierry Templier
author
Greenhorn

Joined: Jan 26, 2010
Posts: 15
Perhaps SpringSource Slices is what you're looking for...
See http://blog.springsource.com/2009/06/22/modular-web-applications-with-springsource-slices/
Thierry
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42038
    
  64
Along these lines you might also want to look at Impala, which is also about using OSGi on top of Spring.


Ping & DNS - my free Android networking tools app
Rainer Eschen
author
Ranch Hand

Joined: Jan 24, 2009
Posts: 75
The Spring Slices stuff looks interesting.
 
GeeCON Prague 2014
 
subject: Spring DM for Web Applications