开发者

Using Web Flow 2 in JSF application

I created a JSF cart application which runs just fine. I am using 'redirect' to fix the problem with refresh. The problem is when there is multiple page flow logic like if you haven't signed up you need to sign up or create an account, and once you do that you need to be redirected back to where you were when you were asked to sign up in the first place. So my goal is to use Web Flow 2 in order to make navigation rules easier to code. I have been working on them separately but I don't know how to merge so that Web Flow开发者_开发知识库 can handle navigation instead.

Any help is very much appreciated. Thanks.


You do that using view states:

<view-state id="login">
   <transition on="someAction" to="secondState">        
   </transition>
</view-state>
<view-state id="secondState">
   <transition on="someAction" to="thirdState">     
   </transition>
</view-state>
<view-state id="thirdstate">
   <transition on="someAction" to="login">      
   </transition>
</view-state>

You define someAction as a <h:commandbutton action="someAction" ...

And inside transitions you perform logic like saving in the database, validating, whatever.

You can check out the guys from http://www.springfuse.com/. After you generate a JSF(Primefaces)+Webflow +... project you`ll be able to learn alot more.


This site is very useful:

http://www.springbyexample.org/examples/simple-spring-web-flow-webapp-spring-config.html

You can also refer to spring web flow resources and look for JSF integration, but that is not very clear.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜