How a flashcard works inside a Grails frame

Flash, which is a temporary storage card for a single request.

I am wondering how this is implemented in grails main framework

In particular, I am interested in the class (s) responsible for placing a flash card in the request, and then outputting it after the request is processed with a high degree of detail.

+4
source share
2 answers

Flash is actually a temporary storage card for this request and only the next request. It will not save the records after the next request, unless the records are repeatedly filled in the next request (which will be current in the future). Here's how it works in Grails:

, , ..

+10

:

class MyController {
  def index() {
    println flash.getClass().name
  }
}

, org.codehaus.groovy.grails.web.servlet.GrailsFlashScope. , ConcurrentHashMap: .

, (. registerWithSessionIfNecessary).

+1

Source: https://habr.com/ru/post/1533445/


All Articles