开发者

Is Spring Webflow suitable for async. flows?

I've got my first impression of Spring WebFlow 2.1 from studying the reference app and reading the manual. Before going further, I would like to ask for the impression of this community.

Actually, I plan my site to consist of only one single web page. Everything (login/logout, adding elements etc.) else is supposed to be updated via async. communication. However, my first impression of Spring WebFlow is that it glues the flow of successive webpages, not their fragment.

Hence, two questions: 开发者_如何转开发

  • Would anyone recommend Spring WebFlow for such a page?
  • Is Spring MVC capable of such a strategy?

Thanks in advance


Spring Webflow is excellent in flow communication of applications. The asynchronous support of webflow however specializes in fragment updating. It therefor is very difficult to handle asynchronus ajax transitions.

Consider an execution contains two elements, execution number and state id. The execution number tells webflow that for this flow it has been started N number of times. The state id tells webflow the user is on this step (transition/state) of the flow which is associated to the corresponding execution number.

When you try to render a fragment the tutorials will tell you to not transition to any state (that is <transition on="someFragment"> <render fragments="some_tilel"/>... </transition>. If you were to transition to another state, you will increment the state id (if it was 2 when entering the page webflow now thinks it 3) however you have not changed the page at all. So everything on the page expects the next state Id to be 3 but the next one will actually be 4.

It can get very complicated, as you can imagine. My suggestion is that you should only use ajax support from webflow to update information on the page and to shy away from flow control.


How are you handling AJAX request with multiple fragments. We are unable to render multiple fragments at the same time due to springwebflow supporting a single model at individual view state and not for individual fragments

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜