views:

40

answers:

1

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

+1  A: 

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.

John V.
Dear John, thank you very much for explaining in such a clear manner what I have been assuming. Your suggestion to make use of ajax support from webflow is still very useful to me and I shall make it so.