PDA

View Full Version : spring mvc Vs spring portlet


ghufran
Sep 13th, 2007, 06:29 AM
Hi

In my application, I have used spring mvc throughout.
I am new to the portlets. My question are

1. Is it possible to integrate spring portlets into an application of spring web-mvc?
2. is it possible that my current application keep as is and the new development is done in spring portlets and the two also communicate with each other easily

Please advise

Thanks
Ghufran

johnalewis
Sep 13th, 2007, 12:29 PM
You can run both a servlet-based interface and a portlet-based interface out of the same webapp and those interfaces can share common services that are declared as beans in the webapp-level application context. You will need separate MVC code for each interface, although you will likely find that you can factor out a lot of common code into shared services -- those layers should end up being pretty thin.

Normally it doesn't make much sense to provide the same capability out of both interfaces. You may want to provide access to simple tasks or "dashboard" views of the application from portlets and then build the more serious interfaces as traditional servlets so that you are in full control of the browser.

Your portlets and servlets can communicate with eachother either through their common services or through a shared session -- getting portlets and servlets to share session data is a bit tricky, so look at this FAQ entry (http://opensource.atlassian.com/confluence/spring/x/Oww) for more info on this.

Now, given that your portlets runs in the same container as your portal, you may not want to run both interfaces from out of the same webapp for scalability reasons -- but that goes more to the overall enterprise architecture, expected concurrent usage, etc.