object Assets extends AssetsBuilder
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. If a digest file is available for a given asset then its contents are read and used to supply a digest value. This value will be used for serving up ETag values and for the purposes of reverse routing. For example given "a.js", if there is an "a.js.md5" file available then the latter contents will be used to determine the Etag value. The reverse router also uses the digest in order to translate any file to the form <digest>-<asset> for example "a.js" may be also found at "d41d8cd98f00b204e9800998ecf8427e-a.js". If there is no digest file found then digest values for ETags are formed by forming a sha1 digest of the last-modified time.
The default digest algorithm to search for is "md5". You can override this quite easily. For example if the SHA-1 algorithm is preferred:
"play.assets.digest.algorithm" = "sha1"
You can set a custom Cache directive for a particular resource if needed. For example in your application.conf file:
"play.assets.cache./public/images/logo.png" = "max-age=3600"
You can use this controller in any application, just by declaring the appropriate route. For example:
GET /assets/*file controllers.Assets.at(path="/public", file)
- Source
- Assets.scala
- Alphabetic
- By Inheritance
- Assets
- AssetsBuilder
- ControllerHelpers
- RequestImplicits
- Rendering
- RequestExtractors
- AcceptExtractors
- ContentTypes
- HeaderNames
- Status
- HttpProtocol
- Results
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Type Members
-
case class
Asset(name: String) extends Product with Serializable
An asset.
An asset.
- name
The name of the asset.
-
class
Status extends Result
Generates default
Result
from a content type, headers and content.Generates default
Result
from a content type, headers and content.- Definition Classes
- Results
Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
val
ACCEPT: String
- Definition Classes
- HeaderNames
-
val
ACCEPTED: Int
- Definition Classes
- Status
-
val
ACCEPT_CHARSET: String
- Definition Classes
- HeaderNames
-
val
ACCEPT_ENCODING: String
- Definition Classes
- HeaderNames
-
val
ACCEPT_LANGUAGE: String
- Definition Classes
- HeaderNames
-
val
ACCEPT_RANGES: String
- Definition Classes
- HeaderNames
-
val
ACCESS_CONTROL_ALLOW_CREDENTIALS: String
- Definition Classes
- HeaderNames
-
val
ACCESS_CONTROL_ALLOW_HEADERS: String
- Definition Classes
- HeaderNames
-
val
ACCESS_CONTROL_ALLOW_METHODS: String
- Definition Classes
- HeaderNames
-
val
ACCESS_CONTROL_ALLOW_ORIGIN: String
- Definition Classes
- HeaderNames
-
val
ACCESS_CONTROL_EXPOSE_HEADERS: String
- Definition Classes
- HeaderNames
-
val
ACCESS_CONTROL_MAX_AGE: String
- Definition Classes
- HeaderNames
-
val
ACCESS_CONTROL_REQUEST_HEADERS: String
- Definition Classes
- HeaderNames
-
val
ACCESS_CONTROL_REQUEST_METHOD: String
- Definition Classes
- HeaderNames
-
val
AGE: String
- Definition Classes
- HeaderNames
-
val
ALLOW: String
- Definition Classes
- HeaderNames
-
val
AUTHORIZATION: String
- Definition Classes
- HeaderNames
-
val
Accepted: Status
Generates a ‘202 ACCEPTED’ result.
Generates a ‘202 ACCEPTED’ result.
- Definition Classes
- Results
-
val
Action: ActionBuilder[Request, AnyContent]
- Attributes
- protected
- Definition Classes
- AssetsBuilder
-
val
BAD_GATEWAY: Int
- Definition Classes
- Status
-
val
BAD_REQUEST: Int
- Definition Classes
- Status
-
val
BINARY: String
Content-Type of binary data.
Content-Type of binary data.
- Definition Classes
- ContentTypes
-
val
BadGateway: Status
Generates a ‘502 BAD_GATEWAY’ result.
Generates a ‘502 BAD_GATEWAY’ result.
- Definition Classes
- Results
-
val
BadRequest: Status
Generates a ‘400 BAD_REQUEST’ result.
Generates a ‘400 BAD_REQUEST’ result.
- Definition Classes
- Results
-
val
CACHE_CONTROL: String
- Definition Classes
- HeaderNames
-
val
CACHE_MANIFEST: String
Content-Type of application cache.
Content-Type of application cache.
- Definition Classes
- ContentTypes
-
val
CHUNKED: String
- Definition Classes
- HttpProtocol
-
val
CONFLICT: Int
- Definition Classes
- Status
-
val
CONNECTION: String
- Definition Classes
- HeaderNames
-
val
CONTENT_DISPOSITION: String
- Definition Classes
- HeaderNames
-
val
CONTENT_ENCODING: String
- Definition Classes
- HeaderNames
-
val
CONTENT_LANGUAGE: String
- Definition Classes
- HeaderNames
-
val
CONTENT_LENGTH: String
- Definition Classes
- HeaderNames
-
val
CONTENT_LOCATION: String
- Definition Classes
- HeaderNames
-
val
CONTENT_MD5: String
- Definition Classes
- HeaderNames
-
val
CONTENT_RANGE: String
- Definition Classes
- HeaderNames
-
val
CONTENT_SECURITY_POLICY: String
- Definition Classes
- HeaderNames
-
val
CONTENT_SECURITY_POLICY_REPORT_ONLY: String
- Definition Classes
- HeaderNames
-
val
CONTENT_TRANSFER_ENCODING: String
- Definition Classes
- HeaderNames
-
val
CONTENT_TYPE: String
- Definition Classes
- HeaderNames
-
val
CONTINUE: Int
- Definition Classes
- Status
-
val
COOKIE: String
- Definition Classes
- HeaderNames
-
val
CREATED: Int
- Definition Classes
- Status
-
def
CSS(implicit codec: Codec): String
Content-Type of css.
Content-Type of css.
- Definition Classes
- ContentTypes
-
val
Conflict: Status
Generates a ‘409 CONFLICT’ result.
Generates a ‘409 CONFLICT’ result.
- Definition Classes
- Results
-
val
Continue: Result
Generates a ‘100 Continue’ result.
Generates a ‘100 Continue’ result.
- Definition Classes
- Results
-
val
Created: Status
Generates a ‘201 CREATED’ result.
Generates a ‘201 CREATED’ result.
- Definition Classes
- Results
-
val
DATE: String
- Definition Classes
- HeaderNames
-
val
ETAG: String
- Definition Classes
- HeaderNames
-
def
EVENT_STREAM(implicit codec: Codec): String
Content-Type of server sent events.
Content-Type of server sent events.
- Definition Classes
- ContentTypes
-
val
EXPECT: String
- Definition Classes
- HeaderNames
-
val
EXPECTATION_FAILED: Int
- Definition Classes
- Status
-
val
EXPIRES: String
- Definition Classes
- HeaderNames
-
val
EntityTooLarge: Status
Generates a ‘413 REQUEST_ENTITY_TOO_LARGE’ result.
Generates a ‘413 REQUEST_ENTITY_TOO_LARGE’ result.
- Definition Classes
- Results
-
val
ExpectationFailed: Status
Generates a ‘417 EXPECTATION_FAILED’ result.
Generates a ‘417 EXPECTATION_FAILED’ result.
- Definition Classes
- Results
-
val
FAILED_DEPENDENCY: Int
- Definition Classes
- Status
-
val
FORBIDDEN: Int
- Definition Classes
- Status
-
val
FORM: String
Content-Type of form-urlencoded.
Content-Type of form-urlencoded. This content type does not define a charset parameter.
- Definition Classes
- ContentTypes
-
val
FORWARDED: String
- Definition Classes
- HeaderNames
-
val
FOUND: Int
- Definition Classes
- Status
-
val
FROM: String
- Definition Classes
- HeaderNames
-
val
FailedDependency: Status
Generates a ‘424 FAILED_DEPENDENCY’ result.
Generates a ‘424 FAILED_DEPENDENCY’ result.
- Definition Classes
- Results
-
val
Forbidden: Status
Generates a ‘403 FORBIDDEN’ result.
Generates a ‘403 FORBIDDEN’ result.
- Definition Classes
- Results
-
def
Found(url: String): Result
Generates a ‘302 FOUND’ simple result.
-
val
GATEWAY_TIMEOUT: Int
- Definition Classes
- Status
-
val
GONE: Int
- Definition Classes
- Status
-
val
GatewayTimeout: Status
Generates a ‘504 GATEWAY_TIMEOUT’ result.
Generates a ‘504 GATEWAY_TIMEOUT’ result.
- Definition Classes
- Results
-
val
Gone: Status
Generates a ‘410 GONE’ result.
Generates a ‘410 GONE’ result.
- Definition Classes
- Results
-
val
HOST: String
- Definition Classes
- HeaderNames
-
def
HTML(implicit codec: Codec): String
Content-Type of html.
Content-Type of html.
- Definition Classes
- ContentTypes
-
val
HTTP_1_0: String
- Definition Classes
- HttpProtocol
-
val
HTTP_1_1: String
- Definition Classes
- HttpProtocol
-
val
HTTP_VERSION_NOT_SUPPORTED: Int
- Definition Classes
- Status
-
val
HttpVersionNotSupported: Status
Generates a ‘505 HTTP_VERSION_NOT_SUPPORTED’ result.
Generates a ‘505 HTTP_VERSION_NOT_SUPPORTED’ result.
- Definition Classes
- Results
-
val
IF_MATCH: String
- Definition Classes
- HeaderNames
-
val
IF_MODIFIED_SINCE: String
- Definition Classes
- HeaderNames
-
val
IF_NONE_MATCH: String
- Definition Classes
- HeaderNames
-
val
IF_RANGE: String
- Definition Classes
- HeaderNames
-
val
IF_UNMODIFIED_SINCE: String
- Definition Classes
- HeaderNames
-
val
IM_A_TEAPOT: Int
- Definition Classes
- Status
-
val
INSUFFICIENT_STORAGE: Int
- Definition Classes
- Status
-
val
INTERNAL_SERVER_ERROR: Int
- Definition Classes
- Status
-
val
ImATeapot: Status
Generates a ‘418 IM_A_TEAPOT’ result.
Generates a ‘418 IM_A_TEAPOT’ result.
- Definition Classes
- Results
-
val
InsufficientStorage: Status
Generates a ‘507 INSUFFICIENT_STORAGE’ result.
Generates a ‘507 INSUFFICIENT_STORAGE’ result.
- Definition Classes
- Results
-
val
InternalServerError: Status
Generates a ‘500 INTERNAL_SERVER_ERROR’ result.
Generates a ‘500 INTERNAL_SERVER_ERROR’ result.
- Definition Classes
- Results
-
def
JAVASCRIPT(implicit codec: Codec): String
Content-Type of javascript.
Content-Type of javascript.
- Definition Classes
- ContentTypes
-
val
JSON: String
Content-Type of json.
Content-Type of json. This content type does not define a charset parameter.
- Definition Classes
- ContentTypes
-
val
LAST_MODIFIED: String
- Definition Classes
- HeaderNames
-
val
LENGTH_REQUIRED: Int
- Definition Classes
- Status
-
val
LINK: String
- Definition Classes
- HeaderNames
-
val
LOCATION: String
- Definition Classes
- HeaderNames
-
val
LOCKED: Int
- Definition Classes
- Status
-
val
Locked: Status
Generates a ‘423 LOCKED’ result.
Generates a ‘423 LOCKED’ result.
- Definition Classes
- Results
-
val
MAX_FORWARDS: String
- Definition Classes
- HeaderNames
-
val
METHOD_NOT_ALLOWED: Int
- Definition Classes
- Status
-
val
MOVED_PERMANENTLY: Int
- Definition Classes
- Status
-
val
MULTIPLE_CHOICES: Int
- Definition Classes
- Status
-
val
MULTI_STATUS: Int
- Definition Classes
- Status
-
val
MethodNotAllowed: Status
Generates a ‘405 METHOD_NOT_ALLOWED’ result.
Generates a ‘405 METHOD_NOT_ALLOWED’ result.
- Definition Classes
- Results
-
def
MovedPermanently(url: String): Result
Generates a ‘301 MOVED_PERMANENTLY’ simple result.
Generates a ‘301 MOVED_PERMANENTLY’ simple result.
- url
the URL to redirect to
- Definition Classes
- Results
-
val
MultiStatus: Status
Generates a ‘207 MULTI_STATUS’ result.
Generates a ‘207 MULTI_STATUS’ result.
- Definition Classes
- Results
-
val
NETWORK_AUTHENTICATION_REQUIRED: Int
- Definition Classes
- Status
-
val
NON_AUTHORITATIVE_INFORMATION: Int
- Definition Classes
- Status
-
val
NOT_ACCEPTABLE: Int
- Definition Classes
- Status
-
val
NOT_FOUND: Int
- Definition Classes
- Status
-
val
NOT_IMPLEMENTED: Int
- Definition Classes
- Status
-
val
NOT_MODIFIED: Int
- Definition Classes
- Status
-
val
NO_CONTENT: Int
- Definition Classes
- Status
-
val
NetworkAuthenticationRequired: Status
Generates a ‘511 NETWORK_AUTHENTICATION_REQUIRED’ result.
Generates a ‘511 NETWORK_AUTHENTICATION_REQUIRED’ result.
- Definition Classes
- Results
-
val
NoContent: Result
Generates a ‘204 NO_CONTENT’ result.
Generates a ‘204 NO_CONTENT’ result.
- Definition Classes
- Results
-
val
NonAuthoritativeInformation: Status
Generates a ‘203 NON_AUTHORITATIVE_INFORMATION’ result.
Generates a ‘203 NON_AUTHORITATIVE_INFORMATION’ result.
- Definition Classes
- Results
-
val
NotAcceptable: Status
Generates a ‘406 NOT_ACCEPTABLE’ result.
Generates a ‘406 NOT_ACCEPTABLE’ result.
- Definition Classes
- Results
-
val
NotFound: Status
Generates a ‘404 NOT_FOUND’ result.
Generates a ‘404 NOT_FOUND’ result.
- Definition Classes
- Results
-
val
NotImplemented: Status
Generates a ‘501 NOT_IMPLEMENTED’ result.
Generates a ‘501 NOT_IMPLEMENTED’ result.
- Definition Classes
- Results
-
val
NotModified: Result
Generates a ‘304 NOT_MODIFIED’ result.
Generates a ‘304 NOT_MODIFIED’ result.
- Definition Classes
- Results
-
val
OK: Int
- Definition Classes
- Status
-
val
ORIGIN: String
- Definition Classes
- HeaderNames
-
val
Ok: Status
Generates a ‘200 OK’ result.
Generates a ‘200 OK’ result.
- Definition Classes
- Results
-
val
PARTIAL_CONTENT: Int
- Definition Classes
- Status
-
val
PAYMENT_REQUIRED: Int
- Definition Classes
- Status
-
val
PERMANENT_REDIRECT: Int
- Definition Classes
- Status
-
val
PRAGMA: String
- Definition Classes
- HeaderNames
-
val
PRECONDITION_FAILED: Int
- Definition Classes
- Status
-
val
PRECONDITION_REQUIRED: Int
- Definition Classes
- Status
-
val
PROXY_AUTHENTICATE: String
- Definition Classes
- HeaderNames
-
val
PROXY_AUTHENTICATION_REQUIRED: Int
- Definition Classes
- Status
-
val
PROXY_AUTHORIZATION: String
- Definition Classes
- HeaderNames
-
val
PartialContent: Status
Generates a ‘206 PARTIAL_CONTENT’ result.
Generates a ‘206 PARTIAL_CONTENT’ result.
- Definition Classes
- Results
-
val
PaymentRequired: Status
Generates a ‘402 PAYMENT_REQUIRED’ result.
Generates a ‘402 PAYMENT_REQUIRED’ result.
- Definition Classes
- Results
-
def
PermanentRedirect(url: String): Result
Generates a ‘308 PERMANENT_REDIRECT’ simple result.
Generates a ‘308 PERMANENT_REDIRECT’ simple result.
- url
the URL to redirect to
- Definition Classes
- Results
-
val
PreconditionFailed: Status
Generates a ‘412 PRECONDITION_FAILED’ result.
Generates a ‘412 PRECONDITION_FAILED’ result.
- Definition Classes
- Results
-
val
PreconditionRequired: Status
Generates a ‘428 PRECONDITION_REQUIRED’ result.
Generates a ‘428 PRECONDITION_REQUIRED’ result.
- Definition Classes
- Results
-
val
RANGE: String
- Definition Classes
- HeaderNames
-
val
REFERER: String
- Definition Classes
- HeaderNames
-
val
REFERRER_POLICY: String
- Definition Classes
- HeaderNames
-
val
REQUESTED_RANGE_NOT_SATISFIABLE: Int
- Definition Classes
- Status
-
val
REQUEST_ENTITY_TOO_LARGE: Int
- Definition Classes
- Status
-
val
REQUEST_HEADER_FIELDS_TOO_LARGE: Int
- Definition Classes
- Status
-
val
REQUEST_TIMEOUT: Int
- Definition Classes
- Status
-
val
REQUEST_URI_TOO_LONG: Int
- Definition Classes
- Status
-
val
RESET_CONTENT: Int
- Definition Classes
- Status
-
val
RETRY_AFTER: String
- Definition Classes
- HeaderNames
-
def
Redirect(call: Call, status: Int): Result
Generates a redirect simple result.
Generates a redirect simple result.
- call
Call defining the URL to redirect to, which typically comes from the reverse router
- status
HTTP status for redirect, such as SEE_OTHER, MOVED_TEMPORARILY or MOVED_PERMANENTLY
- Definition Classes
- Results
-
def
Redirect(call: Call): Result
Generates a redirect simple result.
Generates a redirect simple result.
- call
Call defining the URL to redirect to, which typically comes from the reverse router
- Definition Classes
- Results
-
def
Redirect(url: String, queryString: Map[String, Seq[String]] = Map.empty, status: Int = SEE_OTHER): Result
Generates a redirect simple result.
Generates a redirect simple result.
- url
the URL to redirect to
- queryString
queryString parameters to add to the queryString
- status
HTTP status for redirect, such as SEE_OTHER, MOVED_TEMPORARILY or MOVED_PERMANENTLY
- Definition Classes
- Results
-
def
Redirect(url: String, status: Int): Result
Generates a redirect simple result.
Generates a redirect simple result.
- url
the URL to redirect to
- status
HTTP status
- Definition Classes
- Results
-
val
RequestHeaderFieldsTooLarge: Status
Generates a ‘431 REQUEST_HEADER_FIELDS_TOO_LARGE’ result.
Generates a ‘431 REQUEST_HEADER_FIELDS_TOO_LARGE’ result.
- Definition Classes
- Results
-
val
RequestTimeout: Status
Generates a ‘408 REQUEST_TIMEOUT’ result.
Generates a ‘408 REQUEST_TIMEOUT’ result.
- Definition Classes
- Results
-
val
ResetContent: Result
Generates a ‘205 RESET_CONTENT’ result.
Generates a ‘205 RESET_CONTENT’ result.
- Definition Classes
- Results
-
val
SEE_OTHER: Int
- Definition Classes
- Status
-
val
SERVER: String
- Definition Classes
- HeaderNames
-
val
SERVICE_UNAVAILABLE: Int
- Definition Classes
- Status
-
val
SET_COOKIE: String
- Definition Classes
- HeaderNames
-
val
SET_COOKIE2: String
- Definition Classes
- HeaderNames
-
val
STRICT_TRANSPORT_SECURITY: String
- Definition Classes
- HeaderNames
-
val
SWITCHING_PROTOCOLS: Int
- Definition Classes
- Status
-
def
SeeOther(url: String): Result
Generates a ‘303 SEE_OTHER’ simple result.
-
val
ServiceUnavailable: Status
Generates a ‘503 SERVICE_UNAVAILABLE’ result.
Generates a ‘503 SERVICE_UNAVAILABLE’ result.
- Definition Classes
- Results
-
def
Status(code: Int): Status
Generates a simple result.
-
val
SwitchingProtocols: Result
Generates a ‘101 Switching Protocols’ result.
Generates a ‘101 Switching Protocols’ result.
- Definition Classes
- Results
-
val
TE: String
- Definition Classes
- HeaderNames
-
val
TEMPORARY_REDIRECT: Int
- Definition Classes
- Status
-
def
TEXT(implicit codec: Codec): String
Content-Type of text.
Content-Type of text.
- Definition Classes
- ContentTypes
-
lazy val
TODO: Action[AnyContent]
Used to mark an action that is still not implemented, e.g.:
Used to mark an action that is still not implemented, e.g.:
def action(query: String) = TODO
- Definition Classes
- ControllerHelpers
-
val
TOO_MANY_REQUESTS: Int
- Definition Classes
- Status
-
val
TRAILER: String
- Definition Classes
- HeaderNames
-
val
TRANSFER_ENCODING: String
- Definition Classes
- HeaderNames
-
def
TemporaryRedirect(url: String): Result
Generates a ‘307 TEMPORARY_REDIRECT’ simple result.
Generates a ‘307 TEMPORARY_REDIRECT’ simple result.
- url
the URL to redirect to
- Definition Classes
- Results
-
val
TooManyRequests: Status
Generates a ‘429 TOO_MANY_REQUESTS’ result.
Generates a ‘429 TOO_MANY_REQUESTS’ result.
- Definition Classes
- Results
-
val
UNAUTHORIZED: Int
- Definition Classes
- Status
-
val
UNPROCESSABLE_ENTITY: Int
- Definition Classes
- Status
-
val
UNSUPPORTED_MEDIA_TYPE: Int
- Definition Classes
- Status
-
val
UPGRADE: String
- Definition Classes
- HeaderNames
-
val
UPGRADE_REQUIRED: Int
- Definition Classes
- Status
-
val
USER_AGENT: String
- Definition Classes
- HeaderNames
-
val
USE_PROXY: Int
- Definition Classes
- Status
-
val
Unauthorized: Status
Generates a ‘401 UNAUTHORIZED’ result.
Generates a ‘401 UNAUTHORIZED’ result.
- Definition Classes
- Results
-
val
UnprocessableEntity: Status
Generates a ‘422 UNPROCESSABLE_ENTITY’ result.
Generates a ‘422 UNPROCESSABLE_ENTITY’ result.
- Definition Classes
- Results
-
val
UnsupportedMediaType: Status
Generates a ‘415 UNSUPPORTED_MEDIA_TYPE’ result.
Generates a ‘415 UNSUPPORTED_MEDIA_TYPE’ result.
- Definition Classes
- Results
-
val
UriTooLong: Status
Generates a ‘414 REQUEST_URI_TOO_LONG’ result.
Generates a ‘414 REQUEST_URI_TOO_LONG’ result.
- Definition Classes
- Results
-
val
VARY: String
- Definition Classes
- HeaderNames
-
val
VIA: String
- Definition Classes
- HeaderNames
-
val
WARNING: String
- Definition Classes
- HeaderNames
-
val
WWW_AUTHENTICATE: String
- Definition Classes
- HeaderNames
-
def
XHTML(implicit codec: Codec): String
Content-Type of xhtml.
Content-Type of xhtml.
- Definition Classes
- ContentTypes
-
def
XML(implicit codec: Codec): String
Content-Type of xml.
Content-Type of xml.
- Definition Classes
- ContentTypes
-
val
X_CONTENT_SECURITY_POLICY_NONCE_HEADER: String
- Definition Classes
- HeaderNames
-
val
X_CONTENT_TYPE_OPTIONS: String
- Definition Classes
- HeaderNames
-
val
X_FORWARDED_FOR: String
- Definition Classes
- HeaderNames
-
val
X_FORWARDED_HOST: String
- Definition Classes
- HeaderNames
-
val
X_FORWARDED_PORT: String
- Definition Classes
- HeaderNames
-
val
X_FORWARDED_PROTO: String
- Definition Classes
- HeaderNames
-
val
X_FRAME_OPTIONS: String
- Definition Classes
- HeaderNames
-
val
X_PERMITTED_CROSS_DOMAIN_POLICIES: String
- Definition Classes
- HeaderNames
-
val
X_REQUESTED_WITH: String
- Definition Classes
- HeaderNames
-
val
X_XSS_PROTECTION: String
- Definition Classes
- HeaderNames
- val alternativeDateFormatWithTZOffset: DateTimeFormatter
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
def
clone(): AnyRef
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @native() @throws( ... )
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
equals(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
finalize(): Unit
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] )
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
def
hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- def parseModifiedDate(date: String): Option[Date]
-
implicit
def
request2flash(implicit request: RequestHeader): Flash
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 = request2flash("message") Ok("Got " + message) }
- Definition Classes
- RequestImplicits
-
implicit
def
request2session(implicit request: RequestHeader): Session
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 = request2session("username") Ok("Hello " + username) }
- Definition Classes
- RequestImplicits
- val standardDateParserWithoutTZ: DateTimeFormatter
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
def
toString(): String
- Definition Classes
- AnyRef → Any
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @throws( ... )
-
def
withCharset(mimeType: String)(implicit codec: Codec): String
- returns
the
codec
charset appended tomimeType
- Definition Classes
- ContentTypes
- object Asset extends Serializable
-
object
Accepts
Common extractors to check if a request accepts JSON, Html, etc.
Common extractors to check if a request accepts JSON, Html, etc. Example of use:
request match { case Accepts.Json() => Ok(toJson(value)) case _ => Ok(views.html.show(value)) }
- Definition Classes
- AcceptExtractors
-
object
render
- Definition Classes
- Rendering
-
object
&
Convenient extractor allowing to apply two extractors.
Convenient extractor allowing to apply two extractors. Example of use:
request match { case Accepts.Json() & Accepts.Html() => "This request accepts both JSON and HTML" }
- Definition Classes
- RequestExtractors
Deprecated Value Members
-
val
TOO_MANY_REQUEST: Int
- Definition Classes
- Status
- Annotations
- @deprecated
- Deprecated
(Since version 2.6.0) Use TOO_MANY_REQUESTS instead
-
val
TooManyRequest: Status
Generates a ‘429 TOO_MANY_REQUEST’ result.
Generates a ‘429 TOO_MANY_REQUEST’ result.
- Definition Classes
- Results
- Annotations
- @deprecated
- Deprecated
(Since version 2.6.0) Use TooManyRequests instead
-
def
at(path: String, file: String, aggressiveCaching: Boolean): Action[AnyContent]
Generates an
Action
that serves a static resource.Generates an
Action
that serves a static resource.- path
the root folder for searching the static resource files, such as
"/public"
. Not URL encoded.- file
the file part extracted from the URL. May be URL encoded (note that %2F decodes to literal /).
- aggressiveCaching
if true then an aggressive set of caching directives will be used. Defaults to false.
- Definition Classes
- Assets → AssetsBuilder
- Annotations
- @deprecated
- Deprecated
(Since version 2.6.0) Inject Assets and use Assets#at
-
def
at(file: String): Action[AnyContent]
Generates an
Action
that serves a static resource, using the base asset path from configuration.Generates an
Action
that serves a static resource, using the base asset path from configuration.- Definition Classes
- Assets → AssetsBuilder
- Annotations
- @deprecated
- Deprecated
(Since version 2.6.0) Inject Assets and use Assets#at
-
def
versioned(path: String, file: Asset): Action[AnyContent]
Generates an
Action
that serves a versioned static resource.Generates an
Action
that serves a versioned static resource.- Definition Classes
- Assets → AssetsBuilder
- Annotations
- @deprecated
- Deprecated
(Since version 2.6.0) Inject Assets and use Assets#versioned
-
def
versioned(file: String): Action[AnyContent]
Generates an
Action
that serves a versioned static resource, using the base asset path from configuration.Generates an
Action
that serves a versioned static resource, using the base asset path from configuration.- Definition Classes
- Assets → AssetsBuilder
- Annotations
- @deprecated
- Deprecated
(Since version 2.6.0) Inject Assets and use Assets#versioned