jsfjsf-2flash-scope

What are some uses for the "flash" scope in JSF?


I'm in the process of learning JSF 2.1, and the "flash" scope seems to overlap other scopes. Does this bring any value, or should I disregard it as a modern GOTO: statement? Does it have a higher usage? Is it preferable to use over other types of scope (view, request, etc)?


Solution

  • It's main usage is as follows:

    If it weren't for the flash scope, you would either need to pass the result in a serialized form in the URL, or use forward rather than redirect. But this is bad user experience (if he presses refresh)