When to use spring web flow over spring mvc

Victor picture Victor · Apr 3, 2013 · Viewed 14.3k times · Source

Is it fair to say that the most important justification to use Spring Webflow over Spring MVC is this: Using Spring MVC, the different stages of the workflow needs to be in code. i.e. If Stage 1 ends in success, in the Controller we need to forward to the jsp for stage 2 and so on. In SPring MVC, we cannot do it in xml file.

But in Spring webflow we can configure the flow in xml file without touching code.

Is this wrong or over simplification? I looked at http://forum.springsource.org/showthread.php?16393-Difference-between-Spring-MVC-Web-Framework-and-Web-Flow and was trying to make a summary of the explanation.

Answer

Vinay Lodha picture Vinay Lodha · Apr 3, 2013

If your application have complex Flow pages, events which need to be defined as Finite state machin then use Webflow. It would be justified to use webflow for website where you buy Insurence, Flight Tickets.

Otherwise use normal MVC framework like Struts, learning curve for webflow can be bit hard than other MVC frameworks.

I would say below point mentioned in post is fully justified.

The main point: webflow is a powerful controller. That's it. Use it when you need its power. use plain old controllers where you don't.