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.
精彩评论