Re: Session values set but not available
Re: Session values set but not available
- Subject: Re: Session values set but not available
- From: Kieran Kelleher <email@hidden>
- Date: Mon, 25 Jul 2005 13:43:43 -0400
Hello Ute,
If your component is reusable, as in "stateless", then it is only
created once (in general) and shared across sessions, so the
constructor is called only once. WOComponents should ideally perform
initialization in awake() or just "lazily on demand" for pulling values
into the WOComponent. awake() is provided specifically for
initialization at the beginning of the R-R loop.
http://developer.apple.com/documentation/WebObjects/Reference/API/com/
webobjects/appserver/WOComponent.html#awake()
HTH,
Regards, Kieran
On Jul 25, 2005, at 7:36 AM, Ute Hoffmann wrote:
Hallo,
I have a page that contains several reusable components.
In the constructor of this page I set a value in the session.
I checked, the value is there in this method and the method can
retrieve it from the session, too. But obviously outside of the method
nothing else on the page can see this value in the session.
Neither is the value correctly displayed in the headline of this page
nor is it seen by the reusable components in this page... They all
believe it is null.
But when I insert a variable just to diaplay this value at the top of
the page, I get the right output.
So why is that, where is the problem? When I set this value in an
action method from a navigation bar everything works fine... but then
it is set earlier in the creation process...
Is there a way to set a value in the session in the page constructor
(or somewhere else? Awake?) and have the rest of the page and all
subcomponents see it correctly? There must be. The value I try to set
is a Entity-Value, no simple String, but this should not make any
difference.
Thanks for some insight,
Regards,
Ute
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
email@hidden
This email sent to email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden