(Quick Reference)

flash

目的
Purpose

A temporary storage map that stores objects within the session for the next request and the next request only, automatically clearing out the objects held there after the next request completes.

使用例
Examples


class BookController {

def index() { flash.message = "Welcome!" redirect(action: 'home') }

def home() {} }

詳細
Description

The flash object is a Map (a hash) which you can use to store key value pairs. These values are transparently stored inside the session and then cleared at the end of the next request.

This pattern lets you use HTTP redirects (which is useful for redirect after post ) and retain values that can retrieved from the flash object.