Skip to content

Instantly share code, notes, and snippets.

@natbusa
Last active December 10, 2015 16:28
Show Gist options
  • Save natbusa/4460769 to your computer and use it in GitHub Desktop.
Save natbusa/4460769 to your computer and use it in GitHub Desktop.
Chained Action in Play! Framework: controller example
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