views:

156

answers:

4

Scenario: A fairly mature project uses Struts2 and Spring and Hibernate. I say mature because it has been going on a for a while and there are many struts actions written already.

Suppose we wanted to remove Struts2 from the project and instead depend entirely on Spring MVC without rewriting the entire project.

Is this something that should even be considered? Are there any migration guides out there? Has anyone done this before and would like to warn me against it?

+1  A: 

You can do it slowly. Struts is a MVC framework. The rest of your application (business and data tiers) are classes which can be invoked by action classes. Struts is a plugin based architecture and it is easy for you to define a plugin in struts configuration file.

Take a look at this link. This may help.

Kartik
+1  A: 

I have to ask: What advantages do you see with Spring MVC that aren't being fulfilled by Struts 2?
If there's not at least a handful of "smoking hot" features, or the amount of time saved is more than enough to overcome the time taken for the migration in the first place then it's probably best to stick with what you have.

Ryan P.
It is really a hypothetical question. I think that you are right, we can do everything with Struts2 and we are actually using spring for dependency injection already. I just wondered if it was necessary to use both or better off removing struts and using just Spring.
Vincent Ramdhanie
I understand your curiosity, I had a project awhile back on Struts-2 I also would wonder sometimes if a different framework would make easier/more elegant/fun. :-) It might be worthwhile to maybe create a branch and spend a couple hours moving over one small subset to see how it turns out. Worst case is you'll get some more familiarity with Spring MVC.
Ryan P.
+3  A: 

If it ain't broke, don't fix it. You have very likely better things to do than a migration that won't add any value to the product (and will certainly introduce some bugs). If I were the business, I would never buy such a migration (with close to zero benefits).

Pascal Thivent
A: 

+1 for spring MVC, struts 2 is really slow on the OGNL stuffs....

jimmy