I can't really follow what you want to do, sorry.
I am using the following method, in components, pages, in visit and in
global:
public getMap() {
if (_map == null)
initializeMap();
return _map;
}
this way, it will be null-safe. all you have to worry about is when do
you set it to null...
Cheers,
Ron
ציטוט [EMAIL PROTECTED]:
What about the following:
- a static synchronized hashmap within the global
- initialize it within the constructor of the global object ?
Sarah
--- Ursprüngliche Nachricht ---
Von: Pablo Ruggia <[EMAIL PROTECTED]>
An: Tapestry users <tapestry-user@jakarta.apache.org>
Betreff: Re: Persistent data outside of page scope (setupForRequest...)
Datum: Mon, 6 Jun 2005 02:30:28 -0300
On 6/5/05, [EMAIL PROTECTED]
<[EMAIL PROTECTED]> wrote:
If I want to "remember" data within the global object in a map
and generate it within setupForRequest, it is called and generated for
every
page request....although it should be held within the webserver
somewhere.
Where would I generate it if I only want to generate it once
for the whole web application and not for every page request ?
For the whole application, put it in the global object. You can put
that logic perhaps in a listener declared in your web.xml or in
servlet initialization.
Where and how would I generate it if I only want to generate it once
for a single user for the whole web application ?
For a single user put it into the visit object. You can put the logic
in setupForRequest, if user's data is null then create user data, else
nothing.
Thanks!
---------------------------------------------------------------------
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]
---------------------------------------------------------------------
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]