I realize the benefits listed below are good reasons to go with Spring MVC over Struts but how popular is Spring MVC and how much is it actually being used out there?
I realize why Spring's IOC is popular (and I personally love the dependency injection paradigm); however, for web frameworks is it better to go with Struts at present then to take a risk using Spring MVC? I'm afraid that with sub-projects like Web Flow, the Spring MVC Web Framework might be stable but still work-in-progress (I realize webflow is built on top of Spring MVC).
Being a consultant, I'm always concerned about skill set a customer has in-house from a maintenance perspective, so I'm either considering a "Spring MVC <> Spring IoC <> Hibernate" combo or "Struts <> Spring Ioc <> Hibernate".
Any advise would be appreciated.
1. Spring provides a very clean division between controllers, JavaBean models, and views.
2. Spring's MVC is very flexible. Unlike Struts, which forces your Action and Form objects into concrete inheritance (thus taking away your single shot at concrete inheritance in Java), Spring MVC is entirely based on interfaces. Furthermore, just about every part of the Spring MVC framework is configurable via plugging in your own interface. Of course we also provide convenience classes as an implementation option.
3. Spring, like WebWork, provides interceptors as well as controllers, making it easy to factor out behavior common to the handling of many requests.
4. Spring MVC is truly view-agnostic. You don't get pushed to use JSP if you don't want to; you can use Velocity, XLST or other view technologies. If you want to use a custom view mechanism - for example, your own templating language - you can easily implement the Spring View interface to integrate it.
5. Spring Controllers are configured via IoC like any other objects. This makes them easy to test, and beautifully integrated with other objects managed by Spring.
6. Spring MVC web tiers are typically easier to test than Struts web tiers, due to the avoidance of forced concrete inheritance and explicit dependence of controllers on the dispatcher servlet.
7. The web tier becomes a thin layer on top of a business object layer. This encourages good practice. Struts and other dedicated web frameworks leave you on your own in implementing your business objects; Spring provides an integrated framework for all tiers of your application.