Generates default SimpleResult
from a content type, headers and content.
Generates a ‘202 ACCEPTED’ result.
Generates a ‘202 ACCEPTED’ result.
Content-Type of binary data.
Content-Type of binary data.
Generates a ‘400 BAD_REQUEST’ result.
Generates a ‘400 BAD_REQUEST’ result.
Content-Type of css according the implicit codec value.
Content-Type of css according the implicit codec value.
Generates a ‘409 CONFLICT’ result.
Generates a ‘409 CONFLICT’ result.
Generates a ‘201 CREATED’ result.
Generates a ‘201 CREATED’ result.
Content-Type of server sent events according the implicit codec value
Content-Type of server sent events according the implicit codec value
Generates a ‘413 REQUEST_ENTITY_TOO_LARGE’ result.
Generates a ‘413 REQUEST_ENTITY_TOO_LARGE’ result.
Generates a ‘417 EXPECTATION_FAILED’ result.
Generates a ‘417 EXPECTATION_FAILED’ result.
Content-Type of form-urlencoded according the implicit codec value.
Content-Type of form-urlencoded according the implicit codec value.
Generates a ‘403 FORBIDDEN’ result.
Generates a ‘403 FORBIDDEN’ result.
Generates a ‘302 FOUND’ simple result.
Generates a ‘410 GONE’ result.
Generates a ‘410 GONE’ result.
Content-Type of html according the implicit codec value.
Content-Type of html according the implicit codec value.
Generates a ‘500 INTERNAL_SERVER_ERROR’ result.
Generates a ‘500 INTERNAL_SERVER_ERROR’ result.
Content-Type of javascript according the implicit codec value.
Content-Type of javascript according the implicit codec value.
Content-Type of json according the implicit codec value.
Content-Type of json according the implicit codec value.
Generates a ‘405 METHOD_NOT_ALLOWED’ result.
Generates a ‘405 METHOD_NOT_ALLOWED’ result.
Generates a ‘301 MOVED_PERMANENTLY’ simple result.
Generates a ‘301 MOVED_PERMANENTLY’ simple result.
the URL to redirect to
Generates a ‘204 NO_CONTENT’ result.
Generates a ‘204 NO_CONTENT’ result.
Generates a ‘203 NON_AUTHORITATIVE_INFORMATION’ result.
Generates a ‘203 NON_AUTHORITATIVE_INFORMATION’ result.
Generates a ‘406 NOT_ACCEPTABLE’ result.
Generates a ‘406 NOT_ACCEPTABLE’ result.
Generates a ‘404 NOT_FOUND’ result.
Generates a ‘404 NOT_FOUND’ result.
Generates a ‘501 NOT_IMPLEMENTED’ result.
Generates a ‘501 NOT_IMPLEMENTED’ result.
Generates a ‘304 NOT_MODIFIED’ result.
Generates a ‘304 NOT_MODIFIED’ result.
Generates a ‘200 OK’ result.
Generates a ‘200 OK’ result.
Generates a ‘206 PARTIAL_CONTENT’ result.
Generates a ‘206 PARTIAL_CONTENT’ result.
Generates a ‘412 PRECONDITION_FAILED’ result.
Generates a ‘412 PRECONDITION_FAILED’ result.
Generates a redirect simple result.
Generates a redirect simple result.
Call defining the URL to redirect to, which typically comes from the reverse router
Generates a redirect simple result.
Generates a redirect simple result.
the URL to redirect to
queryString parameters to add to the queryString
HTTP status
Generates a redirect simple result.
Generates a redirect simple result.
the URL to redirect to
HTTP status
Generates a ‘408 REQUEST_TIMEOUT’ result.
Generates a ‘408 REQUEST_TIMEOUT’ result.
Generates a ‘205 RESET_CONTENT’ result.
Generates a ‘205 RESET_CONTENT’ result.
Generates a ‘303 SEE_OTHER’ simple result.
Generates a ‘503 SERVICE_UNAVAILABLE’ result.
Generates a ‘503 SERVICE_UNAVAILABLE’ result.
Generates a simple result.
Content-Type of text according the implicit codec value.
Content-Type of text according the implicit codec value.
Provides an empty Action
implementation: the result is a standard ‘Not implemented yet’ result page.
Provides an empty Action
implementation: the result is a standard ‘Not implemented yet’ result page.
For example:
def index(name:String) = TODO
Generates a ‘307 TEMPORARY_REDIRECT’ simple result.
Generates a ‘307 TEMPORARY_REDIRECT’ simple result.
the URL to redirect to
Generates a ‘429 TOO_MANY_REQUEST’ result.
Generates a ‘429 TOO_MANY_REQUEST’ result.
Generates a ‘401 UNAUTHORIZED’ result.
Generates a ‘401 UNAUTHORIZED’ result.
Generates a ‘415 UNSUPPORTED_MEDIA_TYPE’ result.
Generates a ‘415 UNSUPPORTED_MEDIA_TYPE’ result.
Generates a ‘414 REQUEST_URI_TOO_LONG’ result.
Generates a ‘414 REQUEST_URI_TOO_LONG’ result.
Content-Type of xml according the implicit codec value.
Content-Type of xml according the implicit codec value.
Generates an Action
that serves a static resource.
Generates an Action
that serves a static resource.
the root folder for searching the static resource files, such as "/public"
the file part extracted from the URL
Retrieve the flash scope implicitly from the request.
Retrieve the flash scope implicitly from the request.
For example:
def index(name:String) = Action { implicit request => val message = flash("message") Ok("Got " + message) }
Default body parsers.
Retrieves the session implicitly from the request.
Retrieves the session implicitly from the request.
For example:
def index(name:String) = Action { implicit request => val username = session("username") Ok("Hello " + username) }
Controller that serves static resources.
Resources are searched in the classpath.
It handles Last-Modified and ETag header automatically. If a gzipped version of a resource is found (Same resource name with the .gz suffix), it is served instead.
You can set a custom Cache directive for a particular resource if needed. For example in your application.conf file:
You can use this controller in any application, just by declaring the appropriate route. For example: