FlashMapSupport

org.scalatra.FlashMapSupport
See theFlashMapSupport companion object
trait FlashMapSupport extends Handler

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"))
}

Attributes

See also

FlashMap

Companion
object
Graph
Supertypes
trait Handler
class Object
trait Matchable
class Any
Self type

Members list

Value members

Concrete methods

def flash(implicit request: HttpServletRequest): FlashMap

Returns the org.scalatra.FlashMap instance for the current request.

Returns the org.scalatra.FlashMap instance for the current request.

Attributes

def flash(key: String)(implicit request: HttpServletRequest): Any

Override to implement custom session retriever, or sanity checks if session is still active

Override to implement custom session retriever, or sanity checks if session is still active

Attributes

def handle(req: HttpServletRequest, res: HttpServletResponse): Unit

Handles a request and writes to the response.

Handles a request and writes to the response.

Attributes