What's the best practice for pushing and displaying "flash" messages? It's easy enough for me to add an variable for this:
@Persist("flash") List<String> messages; along with associated display HTML to my layout component, but then getting access to the current layout component from various places sounds tedious. Plus it probably wouldn't work anyways, because the flash persistence is by page & nested component id, and so on. So I guess that means SessionState. Naively, that would look like this: @SessionState(create=false) List<String> messages; Except Generics are dangerous in SessionState, in fact, SessionState is dangerous with anything but a custom type. So that means: @SessionState(create=false) Messages messages; With the Messages object wrapping the list. Presumably Messages has to be serializable. I would have to put an @AfterRender in whatever draws the messages to clear it. Seems simple enough, if tedious. But I was wondering if anyone had come up with a solution they were especially proud of. Pierce
smime.p7s
Description: S/MIME cryptographic signature