Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Spring DM for Web Applications

 
Rainer Eschen
author
Ranch Hand
Posts: 75
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?
 
Thierry Templier
author
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 471
Hibernate Mac OS X Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?
 
Thierry Templier
author
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 75
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Rancher
Posts: 42968
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Along these lines you might also want to look at Impala, which is also about using OSGi on top of Spring.
 
Rainer Eschen
author
Ranch Hand
Posts: 75
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The Spring Slices stuff looks interesting.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic