riccaruf wrote:
> 
> Hi everybody,
> 
> I've got the same question as Angelo in this post
>  http://www.mail-archive.com/users@tapestry.apache.org/msg19237.html
> http://www.mail-archive.com/users@tapestry.apache.org/msg19237.html 
> 
> about the reasons why if I initialize some instance variable on the
> pageLoaded event, the next time
> I load the same page from the pool I find them already initialized without
> any @Persist annotation use.
> 
> I've already read the doc on the page lifecycle and similar but I can't
> understand what appened...:(
> 
> I've read that at the end of the request submission, when the page
> instance in use, is pooled, the instance variables are set at their
> initial/default value. And this is the problem for me. From the t5 doc
> I've read :"...This means that its value resets to its default value at
> the end of reach request (when the page is detached from the request)" ...
> but default value means what I define in the on pageLoaded event ?? (who
> tell me that in the doc?? :) )
> 
> What do I miss ?
> 
> thanks in advance.
> 
> 
> -Rick
> 


I've found my answer in the doc. Sorry for that.

"As with other fields, a default value may be specified inline, or inside a
constructor.

This value is retained and used to reset the value of the field at the end
of each request, before the page is returned to the page pool.

Handling of the null value can be a tricky case, due to the limitations of
the underlying Servlet API. Changing a persistent field's value to null
removes the field's attribute from the session. On later requests, the field
will reset to its default value. Since that is usually null, this is not a
problem ... it is only a problem if a field has a non-null default value and
may be changed to null. "

cheers!
-Rick





-- 
View this message in context: 
http://www.nabble.com/t5-persist-pageLoaded-instance-variable-initialization-tp14838208p15351724.html
Sent from the Tapestry - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to