PDA

View Full Version : Migrating Web-MVC to Portlet-MVC


D. Wacker
Jul 17th, 2007, 04:52 PM
hi all,

i am facing the problem to migrate a full web-mvc application into a portlet mvc version.

The app is quite complexe(several thousands loc only in the web mvc layer). After doing some investigations on the source, I recognize that a lot of business logic is implemented in the web-mvc controller classes. So my question is:


- is there any possibility of reusing the servlet controller in a portlet context



After doing some research and thinking about a may-be-workable-approche the following things came out of my twisted mind ;).

- defining a portlet controller which is fetching the requests and using the web-mvc mapping to figure out which web-mvc controller needs to be used.

- wrapping the portletresquest to a httpRequest and calling the web-mvc controller

- mapping the web mvc controller back to the portlet version


As to say it clear, this approve sounds like an adventure with a lot of pitfalls and my stomache is aching. So, does anybody has a better idea of solving this problem. I am quite new to the springframework, sorry for my may be stupid idea or question and english ;).


Regards,

D. Wacker

Jörg Heinicke
Jul 17th, 2007, 08:57 PM
After doing some investigations on the source, I recognize that a lot of business logic is implemented in the web-mvc controller classes.

Maybe time to refactor it before doing the migration ;)

is there any possibility of reusing the servlet controller in a portlet context

I don't know exactly, but Apache Portals Bridges (http://portals.apache.org/bridges/) might be of help. At least they must have thought about mapping the different request processing concepts.

Jörg

cmelgar
Jul 18th, 2007, 02:32 AM
I don't know exactly, but Apache Portals Bridges (http://portals.apache.org/bridges/) might be of help. At least they must have thought about mapping the different request processing concepts.

Jörg

I have used the Apache Portal Bridges to migrate a Struts application to portal and we have also used the concepts to write a bridge for a client's in-house MVC framework. I'm sure writing a bridge portlet for the Spring would be achievable using the same approach.

woonsan
May 6th, 2008, 12:38 AM
I have used the Apache Portal Bridges to migrate a Struts application to portal and we have also used the concepts to write a bridge for a client's in-house MVC framework. I'm sure writing a bridge portlet for the Spring would be achievable using the same approach.

Hi All,

I'm developing SpringWebMVC portlet bridge to support deploy spring servlet mvc applications as portlet applications in a portal, without any modification.
My problem must be the same as the problem posted in this threads.

The main reason I decided to implement this new bridge solution is that many developers of my company do not have time to learn spring portlet mvc, while they want to deploy their applications as JSR-168 portlets. They have been disciplined with servlet mvc, but, unfortunately, they are not willing to learn spring portlet mvc.
Also, I think this kind of new portlet bridge solution for spring web mvc can be useful for developers who want to write "dual" model spring mvc applications which can be deployed both as servlet or as portlet.

So, I'd like to know if there was any prior effort for this kind of bridging solution. Is there any I can start from?

If there's none, I'd like to pour myself into implementing and contributing this new bridge to Apache Portals Bridges project.

I think spring web mvc bridge need to provide graceful bridging solution between portlet APIs and servlet APIs, but it can have a limitation; it can provide portlet URL conversion with c:url tags of JSTL. (It is same as Struts bridge has tags overriding struts tags.) Therefore, this bridge will be useful for spring servlet mvc application with JSTL view pages.

Please give me some piece of advice.

TIA,

Woonsan