Em Tue, 30 Sep 2008 14:58:03 -0300, Alex Kotchnev <[EMAIL PROTECTED]>
escreveu:
I didn't quite realize that a value in a page persisted in flash scope
was not accessible to other pages ( although now that you mention it, it
seems to make sense) .
It makes sense when you remember the mess that the use of HttpSession
attributes was . . . It was always difficult to figure out who set a given
attribute, and you had to be careful to not reuse the same attribute name
in different pages . . . Argh. I love @Persist. :)
That's an interesting fact that seems to significantly
reduce the usefulness of flash scope, as in a "traditional" web app,
this is the perfect way to pass short lived data between two different
pages.
Don't forget that Tapestry uses redirect-after-post by default, so many
times you @Persist("flash") something because you do not want that
something to remain in the user session.
My applications tend to have a lot of @Persist("flash") and a few @Persist
(almost all them storing search parameters used to fill a Grid).
However, it appears that using a combination of setters and flash scope
should still work, correct ? e.g.
@Persist(value="flash")
User user
public void setUser(User u) {
this.user = u
}
Yes, it would. ;) That's exactly one of its uses:
class Page2 {
@Persist("flash")
private YourData data;
// getters and setters
}
class Page1 {
@Inject
private Page2 page2;
public Object onActionFromSomething() {
...
page2.setData(data);
return page2;
}
}
Thiago
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]