What does flash.discard do? What is the difference from flash.clear ()?

I did not find any documentation on flash.discard(). What is he doing?

+5
source share
2 answers

Looking at the code, this is what I understand:

  • Flash data is ultimately designed to store data between requests.
  • Since Play has no state, this state is stored in the session cookie, which is sent to the client and sent back from the next request.
  • A data card is data that is received from a client through a cookie.
  • Out out Map is the data that the Play application writes to the Flash instance.
  • If the data has changed, the data in Out Map is used to create the contents of the cookie to be sent back to the client.

, , , flash.discard() , , flash.clear() , ...

+5

. , github :

https://github.com/playframework/play/blob/master/framework/src/play/mvc/Scope.java

, , data out. . flash.clear() data, flash.discard() out... Funny...

, =)

+2

All Articles