ExternalAssets
Controller that serves static resources from an external folder. It useful in development mode if you want to serve static assets that shouldn't be part of the build process.
Note that this controller IS NOT intended to be used in production mode and can lead to security issues. Therefore it is automatically disabled in production mode.
All assets are served with max-age=3600 cache directive.
You can use this controller in any application, just by declaring the appropriate route. For example:
GET /assets/\uFEFF*file controllers.ExternalAssets.at(path="/home/peter/myplayapp/external", file)
GET /assets/\uFEFF*file controllers.ExternalAssets.at(path="C:\external", file)
GET /assets/\uFEFF*file controllers.ExternalAssets.at(path="relativeToYourApp", file)
Attributes
- Graph
-
- Supertypes
-
trait ControllerHelperstrait RequestImplicitstrait Renderingtrait RequestExtractorstrait AcceptExtractorstrait ContentTypestrait HeaderNamestrait Statustrait HttpProtocoltrait Resultsclass Objecttrait Matchableclass AnyShow all
Members list
Type members
Inherited classlikes
Convenient extractor allowing to apply two extractors. Example of use:
Convenient extractor allowing to apply two extractors. Example of use:
request match {
case Accepts.Json() & Accepts.Html() => "This request accepts both JSON and HTML"
}
Attributes
- Inherited from:
- RequestExtractors
- Supertypes
-
class Objecttrait Matchableclass Any
Common extractors to check if a request accepts JSON, Html, etc. Example of use:
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))
}
Attributes
- Inherited from:
- AcceptExtractors
- Supertypes
-
class Objecttrait Matchableclass Any
Generates default Result
from a content type, headers and content.
Value members
Concrete methods
Generates an Action
that serves a static resource from an external folder
Generates an Action
that serves a static resource from an external folder
Value parameters
- file
-
the file part extracted from the URL
- rootPath
-
the root folder for searching the static resource files such as
"/home/peter/public"
,C:\external
orrelativeToYourApp
Attributes
Inherited methods
Content-Type of css.
Content-Type of server sent events.
Generates a ‘302 FOUND’ simple result.
Generates a ‘302 FOUND’ simple result.
Value parameters
- url
-
the URL to redirect to
Attributes
- Inherited from:
- Results
Content-Type of html.
Content-Type of javascript.
Generates a ‘301 MOVED_PERMANENTLY’ simple result.
Generates a ‘301 MOVED_PERMANENTLY’ simple result.
Value parameters
- url
-
the URL to redirect to
Attributes
- Inherited from:
- Results
Generates a ‘308 PERMANENT_REDIRECT’ simple result.
Generates a ‘308 PERMANENT_REDIRECT’ simple result.
Value parameters
- url
-
the URL to redirect to
Attributes
- Inherited from:
- Results
Generates a redirect simple result.
Generates a redirect simple result.
Value parameters
- 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
Attributes
- Inherited from:
- Results
Generates a redirect simple result.
Generates a redirect simple result.
Value parameters
- call
-
Call defining the URL to redirect to, which typically comes from the reverse router
Attributes
- Inherited from:
- Results
Generates a redirect simple result.
Generates a redirect simple result.
Value parameters
- queryStringParams
-
queryString parameters to add to the queryString
- status
-
HTTP status for redirect, such as SEE_OTHER, MOVED_TEMPORARILY or MOVED_PERMANENTLY
- url
-
the URL to redirect to
Attributes
- Inherited from:
- Results
Generates a redirect simple result.
Generates a redirect simple result.
Value parameters
- statusCode
-
HTTP status
- url
-
the URL to redirect to
Attributes
- Inherited from:
- Results
Generates a ‘303 SEE_OTHER’ simple result.
Generates a ‘303 SEE_OTHER’ simple result.
Value parameters
- url
-
the URL to redirect to
Attributes
- Inherited from:
- Results
Generates a simple result.
Content-Type of text.
Generates a ‘307 TEMPORARY_REDIRECT’ simple result.
Generates a ‘307 TEMPORARY_REDIRECT’ simple result.
Value parameters
- url
-
the URL to redirect to
Attributes
- Inherited from:
- Results
Content-Type of xhtml.
Content-Type of xml.
Attributes
- Returns
-
the
codec
charset appended tomimeType
- Inherited from:
- ContentTypes
Concrete fields
Inherited fields
Attributes
- Inherited from:
- HeaderNames
Attributes
- Inherited from:
- HeaderNames
Attributes
- Inherited from:
- HeaderNames
Attributes
- Inherited from:
- HeaderNames
Attributes
- Inherited from:
- HeaderNames
Attributes
- Inherited from:
- HeaderNames
Attributes
- Inherited from:
- HeaderNames
Attributes
- Inherited from:
- HeaderNames
Attributes
- Inherited from:
- HeaderNames
Attributes
- Inherited from:
- HeaderNames
Attributes
- Inherited from:
- HeaderNames
Attributes
- Inherited from:
- HeaderNames
Attributes
- Inherited from:
- HeaderNames
Attributes
- Inherited from:
- HeaderNames
Attributes
- Inherited from:
- HeaderNames
Attributes
- Inherited from:
- HeaderNames
Generates a ‘202 ACCEPTED’ result.
Attributes
- Inherited from:
- Status
Attributes
- Inherited from:
- Status
Content-Type of binary data.
Generates a ‘502 BAD_GATEWAY’ result.
Generates a ‘400 BAD_REQUEST’ result.
Attributes
- Inherited from:
- HeaderNames
Content-Type of application cache.
Attributes
- Inherited from:
- HttpProtocol
Attributes
- Inherited from:
- HeaderNames
Attributes
- Inherited from:
- HeaderNames
Attributes
- Inherited from:
- HeaderNames
Attributes
- Inherited from:
- HeaderNames
Attributes
- Inherited from:
- HeaderNames
Attributes
- Inherited from:
- HeaderNames
Attributes
- Inherited from:
- HeaderNames
Attributes
- Inherited from:
- HeaderNames
Attributes
- Inherited from:
- HeaderNames
Attributes
- Inherited from:
- HeaderNames
Attributes
- Inherited from:
- HeaderNames
Attributes
- Inherited from:
- HeaderNames
Attributes
- Inherited from:
- HeaderNames
Generates a ‘409 CONFLICT’ result.
Generates a ‘100 Continue’ result.
Generates a ‘201 CREATED’ result.
Attributes
- Inherited from:
- HeaderNames
Attributes
- Inherited from:
- HeaderNames
Attributes
- Inherited from:
- HeaderNames
Attributes
- Inherited from:
- Status
Attributes
- Inherited from:
- HeaderNames
Generates a ‘413 REQUEST_ENTITY_TOO_LARGE’ result.
Generates a ‘417 EXPECTATION_FAILED’ result.
Attributes
- Inherited from:
- Status
Content-Type of form-urlencoded. This content type does not define a charset parameter.
Content-Type of form-urlencoded. This content type does not define a charset parameter.
Attributes
- Inherited from:
- ContentTypes
Attributes
- Inherited from:
- HeaderNames
Attributes
- Inherited from:
- HeaderNames
Generates a ‘424 FAILED_DEPENDENCY’ result.
Generates a ‘403 FORBIDDEN’ result.
Attributes
- Inherited from:
- Status
Generates a ‘504 GATEWAY_TIMEOUT’ result.
Generates a ‘410 GONE’ result.
Attributes
- Inherited from:
- HeaderNames
Attributes
- Inherited from:
- HttpProtocol
Attributes
- Inherited from:
- HttpProtocol
Attributes
- Inherited from:
- HttpProtocol
Attributes
- Inherited from:
- Status
Generates a ‘505 HTTP_VERSION_NOT_SUPPORTED’ result.
Attributes
- Inherited from:
- HeaderNames
Attributes
- Inherited from:
- HeaderNames
Attributes
- Inherited from:
- HeaderNames
Attributes
- Inherited from:
- HeaderNames
Attributes
- Inherited from:
- HeaderNames
Attributes
- Inherited from:
- Status
Attributes
- Inherited from:
- Status
Attributes
- Inherited from:
- Status
Generates a ‘418 IM_A_TEAPOT’ result.
Generates a ‘507 INSUFFICIENT_STORAGE’ result.
Generates a ‘500 INTERNAL_SERVER_ERROR’ result.
Content-Type of json. This content type does not define a charset parameter.
Content-Type of json. This content type does not define a charset parameter.
Attributes
- Inherited from:
- ContentTypes
Attributes
- Inherited from:
- HeaderNames
Attributes
- Inherited from:
- Status
Attributes
- Inherited from:
- HeaderNames
Attributes
- Inherited from:
- HeaderNames
Generates a ‘423 LOCKED’ result.
Attributes
- Inherited from:
- HeaderNames
Attributes
- Inherited from:
- Status
Attributes
- Inherited from:
- Status
Attributes
- Inherited from:
- Status
Attributes
- Inherited from:
- Status
Generates a ‘405 METHOD_NOT_ALLOWED’ result.
Generates a ‘207 MULTI_STATUS’ result.
Attributes
- Inherited from:
- Status
Attributes
- Inherited from:
- Status
Attributes
- Inherited from:
- Status
Attributes
- Inherited from:
- Status
Attributes
- Inherited from:
- Status
Attributes
- Inherited from:
- Status
Generates a ‘511 NETWORK_AUTHENTICATION_REQUIRED’ result.
Generates a ‘204 NO_CONTENT’ result.
Generates a ‘203 NON_AUTHORITATIVE_INFORMATION’ result.
Generates a ‘406 NOT_ACCEPTABLE’ result.
Generates a ‘404 NOT_FOUND’ result.
Generates a ‘501 NOT_IMPLEMENTED’ result.
Generates a ‘304 NOT_MODIFIED’ result.
Attributes
- Inherited from:
- HeaderNames
Generates a ‘200 OK’ result.
Attributes
- Inherited from:
- Status
Attributes
- Inherited from:
- Status
Attributes
- Inherited from:
- Status
Attributes
- Inherited from:
- HeaderNames
Attributes
- Inherited from:
- Status
Attributes
- Inherited from:
- Status
Attributes
- Inherited from:
- HeaderNames
Attributes
- Inherited from:
- Status
Attributes
- Inherited from:
- HeaderNames
Generates a ‘206 PARTIAL_CONTENT’ result.
Generates a ‘402 PAYMENT_REQUIRED’ result.
Generates a ‘412 PRECONDITION_FAILED’ result.
Generates a ‘428 PRECONDITION_REQUIRED’ result.
Attributes
- Inherited from:
- HeaderNames
Attributes
- Inherited from:
- HeaderNames
Attributes
- Inherited from:
- HeaderNames
Attributes
- Inherited from:
- Status
Attributes
- Inherited from:
- Status
Attributes
- Inherited from:
- Status
Attributes
- Inherited from:
- Status
Attributes
- Inherited from:
- Status
Attributes
- Inherited from:
- Status
Attributes
- Inherited from:
- HeaderNames
Generates a ‘431 REQUEST_HEADER_FIELDS_TOO_LARGE’ result.
Generates a ‘408 REQUEST_TIMEOUT’ result.
Generates a ‘205 RESET_CONTENT’ result.
Attributes
- Inherited from:
- HeaderNames
Attributes
- Inherited from:
- Status
Attributes
- Inherited from:
- HeaderNames
Attributes
- Inherited from:
- HeaderNames
Attributes
- Inherited from:
- HeaderNames
Attributes
- Inherited from:
- Status
Generates a ‘503 SERVICE_UNAVAILABLE’ result.
Generates a ‘101 Switching Protocols’ result.
Attributes
- Inherited from:
- HeaderNames
Attributes
- Inherited from:
- Status
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
Attributes
- Inherited from:
- ControllerHelpers
Attributes
- Inherited from:
- Status
Attributes
- Inherited from:
- HeaderNames
Attributes
- Inherited from:
- HeaderNames
Generates a ‘429 TOO_MANY_REQUESTS’ result.
Attributes
- Inherited from:
- Status
Attributes
- Inherited from:
- Status
Attributes
- Inherited from:
- Status
Attributes
- Inherited from:
- HeaderNames
Attributes
- Inherited from:
- Status
Attributes
- Inherited from:
- HeaderNames
Generates a ‘401 UNAUTHORIZED’ result.
Generates a ‘422 UNPROCESSABLE_ENTITY’ result.
Generates a ‘415 UNSUPPORTED_MEDIA_TYPE’ result.
Generates a ‘414 REQUEST_URI_TOO_LONG’ result.
Attributes
- Inherited from:
- HeaderNames
Attributes
- Inherited from:
- HeaderNames
Attributes
- Inherited from:
- HeaderNames
Attributes
- Inherited from:
- HeaderNames
Attributes
- Inherited from:
- HeaderNames
Attributes
- Inherited from:
- HeaderNames
Attributes
- Inherited from:
- HeaderNames
Attributes
- Inherited from:
- HeaderNames
Attributes
- Inherited from:
- HeaderNames
Attributes
- Inherited from:
- HeaderNames
Attributes
- Inherited from:
- HeaderNames
Attributes
- Inherited from:
- HeaderNames
Attributes
- Inherited from:
- HeaderNames
Attributes
- Inherited from:
- HeaderNames
Implicits
Inherited implicits
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)
}
Attributes
- Inherited from:
- RequestImplicits
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)
}
Attributes
- Inherited from:
- RequestImplicits