Last active
December 10, 2015 16:28
-
-
Save natbusa/4460769 to your computer and use it in GitHub Desktop.
Chained Action in Play! Framework: controller example
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| object Collection extends Controller { | |
| def v1Index(path: String) = ChainedAction { | |
| request => | |
| println("v1Index" + ' ' + request.queryString.toString()) | |
| if (1>0) | |
| v1Next(path, "foo") | |
| else | |
| Action(Ok("never here")) | |
| } | |
| def v1Next(path: String, another:String) = ChainedAction { | |
| request => | |
| println("v1Next" + ' ' + request.queryString.toString()) | |
| v1NextNext(path, "bar", "moo") | |
| } | |
| def v1NextNext(path: String, s1:String, s2:String) = ChainedAction { | |
| request => | |
| println("v1NextNext" + ' ' + request.queryString.toString()) | |
| v1Term(path) | |
| } | |
| def v1Term(path:String) = Action { | |
| request => | |
| println("v1Term" + ' ' + request.queryString.toString()) | |
| Ok("ok") | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment