I am trying to implement some flow control in Play 2.0.3, kind of a wizard with several steps. What is the best way to do it in Play?
I want to have multi-step flows, like step1 -> step2 -> finish
The main problem is not to allow user to skip for example step2 and go straight to finish (user can manually input a link in the browser /finish ).
Thanks. Please let me know if I haven’t explained myself well.
A completely stateless way could consist in storing all data in the URLs of steps, where the step
n + 1contains all data from stepn:The advantages of this solution are its simplicity and the fact that checking that all required steps have been completed before the next step is performed for free by the Play! router.
However, if you have a lot of data your URLs will be huge, making this solution less applicable. In such a case, you need to:
/step2URL won’t return the same thing for different users ;