I'm not sure if this is the recommended way, but I find it both easy and
self-descriptive to write wrapper classes for these java objects so you
can use either SessionState or the Environment to move them across pages
in the application. For example, if you have a String for the name of
the user logged in and want to use it on several pages, write a wrapper
class called UserName with a field for the name and setter/getter
methods. You can then pass this around as a POJO as I mentioned before.
It might be slightly annoying to have a handful of wrapper classes like
this. But on the other hand it provides a central location that can be
referenced in the project using an IDE that helps keep track of the
various objects you pass around the pages, rather than digging through
all your page classes looking.
-Rich
On 09/14/2010 12:25 PM, Adam Zimowski wrote:
I understand that @SessionState was meant for POJOs. What's the
preferred (if any) way in Tapestry to store Strings, Integers and such
across multiple pages?
Adam
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]