injected processor
injected body parsers
injected execution context
injected materializer.
Compose this ActionFunction with another, with this one applied first.
Compose this ActionFunction with another, with this one applied first.
ActionFunction with which to compose
The new ActionFunction
Constructs an Action
with default content, and no request parameter.
Constructs an Action
with default content, and no request parameter.
For example:
val hello = Action { Ok("Hello!") }
the action code
an action
Constructs an Action
with default content.
Constructs an Action
with default content.
For example:
val echo = Action { request => Ok("Got request [" + request + "]") }
the action code
an action
Constructs an ActionBuilder with the given BodyParser.
Constructs an ActionBuilder with the given BodyParser. The result can then be applied directly to a block.
For example:
val echo = Action(parse.anyContent) { request => Ok("Got request [" + request + "]") }
the type of the request body
the BodyParser
to use to parse the request body
an action
Constructs an Action
that returns a future of a result, with default content.
Constructs an Action
that returns a future of a result, with default content.
For example:
val hello = Action.async { request => ws.url(request.getQueryString("url").get).get().map { r => if (r.status == 200) Ok("The website is up") else NotFound("The website is down") } }
the action code
an action
Constructs an Action
that returns a future of a result, with default content.
Constructs an Action
that returns a future of a result, with default content.
For example:
val hello = Action.async { request => ws.url(request.getQueryString("url").get).get().map { r => if (r.status == 200) Ok("The website is up") else NotFound("The website is down") } }
the action code
an action
Constructs an Action
that returns a future of a result, with default content, and no request parameter.
Constructs an Action
that returns a future of a result, with default content, and no request parameter.
For example:
val hello = Action.async { ws.url("http://www.playframework.com").get().map { r => if (r.status == 200) Ok("The website is up") else NotFound("The website is down") } }
the action code
an action
Compose another ActionFunction with this one, with this one applied last.
Compose another ActionFunction with this one, with this one applied last.
ActionFunction with which to compose
The new ActionFunction
Compose the action with other actions.
Compose the action with other actions. This allows mixing in of various actions together.
The action to compose
The composed action
Compose the parser.
Compose the parser. This allows the action builder to potentially intercept requests before they are parsed.
The body parser to compose
The composed body parser
injected processor
injected processor
injected execution context
injected execution context
Invoke the block.
Invoke the block. This is the main method that an ActionBuilder has to implement, at this stage it can wrap it in any other actions, modify the request object or potentially use a different class to represent the request.
The request
The block of code to invoke
A future of the result
injected materializer.
injected materializer.
The BodyParser to be used by this ActionBuilder if no other is specified
The default CSPActionBuilder.
This is useful for runtime dependency injection.