org.scalatra
Type members
Classlikes
Adds support for mapping and inferring formats to content types.
Adds support for mapping and inferring formats to content types.
$ - Provides a request-scoped format variable $ - Maps formats to content types and vice versa $ - Augments the content-type inferrer to use the format
- Companion:
- object
A route matcher on a boolean condition. Does not extract any route parameters.
A route matcher on a boolean condition. Does not extract any route parameters.
Represents an HTTP content encoding.
Represents an HTTP content encoding.
- Companion:
- object
Scalatra handler for gzipped responses.
Scalatra handler for gzipped responses.
Represents the value of a content negotiation header.
Represents the value of a content negotiation header.
- Companion:
- object
Defines type classes and helper methods for well known content-negotiation headers.
Defines type classes and helper methods for well known content-negotiation headers.
- Companion:
- class
A collection of methods that affect the control flow of routes.
A collection of methods that affect the control flow of routes.
The core Scalatra DSL.
The core Scalatra DSL.
Provides cross-site request forgery protection.
Provides cross-site request forgery protection.
Adds a before filter. If a request is determined to be forged, the
handleForgery()
hook is invoked. Otherwise, a token for the next
request is prepared with prepareCsrfToken
.
- Companion:
- object
The Scalatra DSL requires a dynamically scoped request and response.
The Scalatra DSL requires a dynamically scoped request and response.
A FlashMap is the data structure used by org.scalatra.FlashMapSupport to allow passing temporary values between sequential actions.
A FlashMap is the data structure used by org.scalatra.FlashMapSupport to allow passing temporary values between sequential actions.
As of Scalatra 2.7.x, it does not directly inherit Map.
- See also:
FlashMapSupport
Allows an action to set key-value pairs in a transient state that is accessible only to the next action and is expired immediately after that. This is especially useful when using the POST-REDIRECT-GET pattern to trace the result of an operation.
Allows an action to set key-value pairs in a transient state that is accessible only to the next action and is expired immediately after that. This is especially useful when using the POST-REDIRECT-GET pattern to trace the result of an operation.
post("/article/create") {
// create session
flash("notice") = "article created successfully"
redirect("/home")
}
get("/home") {
// this will access the value set in previous action
stuff_with(flash("notice"))
}
- See also:
FlashMap
- Companion:
- object
An action and the multi-map of route parameters to invoke it with.
An action and the multi-map of route parameters to invoke it with.
Mixin for clients that only support a limited set of HTTP verbs.
If the request is a POST and the _method
request parameter is set,
the value of the _method
parameter is treated as the request's method.
Mixin for clients that only support a limited set of HTTP verbs.
If the request is a POST and the _method
request parameter is set,
the value of the _method
parameter is treated as the request's method.
- Companion:
- object
A path pattern optionally matches a request path and extracts path parameters.
A path pattern optionally matches a request path and extracts path parameters.
Parses a string into a path pattern for routing.
Parses a string into a path pattern for routing.
- Companion:
- object
Path pattern parser based on Rack::Mount::Strexp, which is used by Rails.
Path pattern parser based on Rack::Mount::Strexp, which is used by Rails.
- Companion:
- object
An implementation of Rails' path pattern syntax
An implementation of Rails' path pattern syntax
A route matcher for regular expressions. Useful for cases that are more complex than are supported by Sinatra- or Rails-style routes.
A route matcher for regular expressions. Useful for cases that are more complex than are supported by Sinatra- or Rails-style routes.
A route matcher from which a URI can be generated from route parameters.
A route matcher from which a URI can be generated from route parameters.
A route is a set of matchers and an action. A route is considered to match if all of its route matchers return Some. If a route matches, its action may be invoked. The route parameters extracted by the matchers are made available to the action.
A route is a set of matchers and an action. A route is considered to match if all of its route matchers return Some. If a route matches, its action may be invoked. The route parameters extracted by the matchers are made available to the action.
- Companion:
- object
A route matcher is evaluated in the context it was created and returns a a (possibly empty) multi-map of parameters if the route is deemed to match.
A route matcher is evaluated in the context it was created and returns a a (possibly empty) multi-map of parameters if the route is deemed to match.
The base implementation of the Scalatra DSL. Intended to be portable to all supported backends.
The base implementation of the Scalatra DSL. Intended to be portable to all supported backends.
- Companion:
- object
An implementation of the Scalatra DSL in a filter. You may prefer a filter to a ScalatraServlet if:
An implementation of the Scalatra DSL in a filter. You may prefer a filter to a ScalatraServlet if:
$ - you are sharing a URL space with another servlet or filter and want to delegate unmatched requests. This is very useful when migrating legacy applications one page or resource at a time.
Unlike a ScalatraServlet, does not send 404 or 405 errors on non-matching routes. Instead, it delegates to the filter chain.
If in doubt, extend ScalatraServlet instead.
- See also:
ScalatraServlet
An implementation of the Scalatra DSL in a servlet. This is the recommended base trait for most Scalatra applications. Use a servlet if:
An implementation of the Scalatra DSL in a servlet. This is the recommended base trait for most Scalatra applications. Use a servlet if:
$ - your Scalatra routes run in a subcontext of your web application. $ - you want Scalatra to have complete control of unmatched requests. $ - you think you want a filter just for serving static content with the default servlet; ScalatraServlet can do this too $ - you don't know the difference
- See also:
ScalatraFilter
This trait provides session support for stateful applications.
This trait provides session support for stateful applications.
A Sinatra-compatible route path pattern parser.
A Sinatra-compatible route path pattern parser.
- Companion:
- object
An implementation of Sinatra's path pattern syntax.
An implementation of Sinatra's path pattern syntax.
Redirects unsecured requests to the corresponding secure URL.
Redirects unsecured requests to the corresponding secure URL.
Adds support for generating URIs from routes and their params.
Adds support for generating URIs from routes and their params.
Types
Value members
Inherited methods
Immediately halts processing of a request. Can be called from either a before filter or a route.
Immediately halts processing of a request. Can be called from either a before filter or a route.
- Value parameters:
- body
a result to render through the render pipeline as the body
- headers
headers to add to the response
- status
the status to set on the response, or null to leave the status unchanged.
- Inherited from:
- Control