I haven't found any documentation on flash.discard()
. What does it do?
After looking at the code, this is what I understand:
So from this, I would say, that flash.discard() is used to throw away everything that would go to the client, and flash.clear() is used to throw away everything that came from the client...
That's a good question. While I don't know the answer either, the source code at github should help:
https://github.com/playframework/play/blob/master/framework/src/play/mvc/Scope.java
A quick glance shows the Scope keeps two hashmaps, one named data
and other named out
.
They both store the same information. But the flash.clear() is acting upon data
and flash.discard() is acting upon out
... Funny...
Better call both, just in case =)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With