trait Action[A] extends EssentialAction
An action is essentially a (Request[A] => Result) function that handles a request and generates a result to be sent to the client.
For example,
val echo = Action { request => Ok("Got request [" + request + "]") }
- A
the type of the request body
- Source
- Action.scala
Linear Supertypes
Known Subclasses
Ordering
- Alphabetic
- By Inheritance
Inherited
- Action
- EssentialAction
- Handler
- Function1
- AnyRef
- Any
- Hide All
- Show All
Visibility
- Public
- Protected
Type Members
- type BODY_CONTENT = A
Type of the request body.
Abstract Value Members
- abstract def apply(request: Request[A]): Future[Result]
Invokes this action.
Invokes this action.
- request
the incoming HTTP request
- returns
the result to be sent to the client
- abstract def executionContext: ExecutionContext
- returns
The execution context to run the action in
- abstract def parser: BodyParser[A]
Body parser associated with this action.
Concrete Value Members
- def andThen[A](g: (Accumulator[ByteString, Result]) => A): (RequestHeader) => A
- Definition Classes
- Function1
- Annotations
- @unspecialized()
- def apply(): Action[A]
- returns
itself, for better support in the routes file.
- Definition Classes
- Action → EssentialAction
- def apply(rh: RequestHeader): Accumulator[ByteString, Result]
- Definition Classes
- Action → Function1
- def asJava: mvc.EssentialAction
- Definition Classes
- EssentialAction
- def compose[A](g: (A) => RequestHeader): (A) => Accumulator[ByteString, Result]
- Definition Classes
- Function1
- Annotations
- @unspecialized()
- def toString(): String
- Definition Classes
- Action → Function1 → AnyRef → Any