Spring MVC Issue

I have a web-app that has some heavy controller logic inside controllers. However I would like to use web-flows on top of this. From what I learn by reading online, spring web flow totally circumvents controllers in a sense that its different states assume controller functionality.

Is it practical to put web flow on top of mvc when I have some really heavy controllers with heavy logic inside it?

I would not like to put such heavy logic inside those flow state-transition-data definitions xmls using spEL. It is ugly and instead they rightly belong to the domain of java space inside controllers.


The spring MVC controllers don't match well with Spring webflow, as Spring Webflow provides a stateful controller built based on the flow definition xml.

But if the logic to determine the next view is not well expressed otherwise, you can make all view states transition to an action state, where you determine via Java code what is the next view:

<action-state id="decideNextView">
    <evaluate expression="someBeans.determineNextView()" />
    <transition on="begin" to="beginState" />
    <transition on="end" to="endState" />
    <transition on="other" to="someOtherState" />
</action-state>

This way the view transition logic is not on the XML but in Java code.

链接地址: http://www.djcxy.com/p/39100.html

上一篇: Web流程添加与表单值绑定的模型属性

下一篇: Spring MVC问题