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 Handlerclass Objecttrait Matchableclass Any
- Self type
Members list
In this article