You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Thijs Suijten <t....@semantica.nl> on 2005/01/06 08:45:52 UTC
RE: Persitent page properties
Anyone??
-----Original Message-----
From: Thijs Suijten [mailto:t.suijten@semantica.nl]
Sent: woensdag 29 december 2004 8:57
To: Tapestry users
Subject: RE: Persitent page properties
I will take a look at the developers list.
I agree that initialization should be done in de pageBeginRender (In the prepareForRender the page recorder is allready locked). In my case I want to do the caching/initialization in a component, this cannot be done in the pageBeginRender because the pageBeginRender is a listener. I don't know in what order the listeners are being called and this causes a problem. The model is being passed to the component by a parameter, which is initialized in the component's-parent-page pageBeginRender. Because I don't know which pageBeginRender is called first I get a NullPointerException, in my case the component's pageBeginRender is being called first and then the component's-parent-page pageBeginRender.
This results not being able to do anything in the component's pageBeginRender because the model is null at that point, because the pageBeginRender is the last place I can set persitent page properties, I have a problem.
I hope you understand my problem, english is not my native tongue so explaining such a complex problem is difficult...
-----Original Message-----
From: Mikaël Cluseau [mailto:nwrk@nwrk.dyndns.org]
Sent: dinsdag 28 december 2004 20:03
To: Tapestry users
Subject: RE: Persitent page properties
Le mardi 28 décembre 2004 à 10:32 +0100, Thijs Suijten a écrit :
> I still don't get it...
>
> It's not a huge problem but it certainly doesn't make life easier... If I want to do some caching in the render phase to prevent StaleLinkExceptions I want to store some values in persistent page properties, I get a page-recorder-locked-error.
>
> So I made a Model which can contain my cached values, I initialize the Model in the pageBeginRender and use the setter to put it in the persitent page property. Now I can store my cached values in the persitent page property using: getModel().storeCache(...);
>
> Isn't this odd?
Not sure, from my point of view everything should be done in the
prepareForRender or something like that (setup phase) and the page
should only renders when it is ready to (the model must be fixed).
Anyway, the technical problem of cookie-based sessions cannot be solved
without caching the full page in-memory, which can be huge and will
cause performance losses.
Tryed to answer... better ask it on the developer list to get an answer
of Howard.
> -----Original Message-----
> From: Mikaël Cluseau [mailto:nwrk@nwrk.dyndns.org]
> Sent: maandag 27 december 2004 3:58
> To: Tapestry users
> Subject: Re: Persitent page properties
>
>
> Le vendredi 24 décembre 2004 à 08:55 +0100, Thijs Suijten a écrit :
> > I've been wordking with Tapestry for quit a while now. I still haven't
> > figured out why persitent page properties cannot be modified during the
> > render phase. (I get a locked error)
> >
> > Can someone please enlighten me?
>
> I think this is because if you don't have a session and that the buffer
> has been sent to the client, you can't open the session (since it is
> cookie based): allowing a persistent property to change during the
> render phase breaks the guarantee to have it persisted.
---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
--
No virus found in this incoming message.
Checked by AVG Anti-Virus.
Version: 7.0.296 / Virus Database: 265.6.5 - Release Date: 26-12-2004
--
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.296 / Virus Database: 265.6.5 - Release Date: 26-12-2004
---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
--
No virus found in this incoming message.
Checked by AVG Anti-Virus.
Version: 7.0.296 / Virus Database: 265.6.5 - Release Date: 26-12-2004
--
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.300 / Virus Database: 265.6.8 - Release Date: 3-1-2005
---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
RE: Persitent page properties
Posted by Mikaël Cluseau <nw...@nwrk.dyndns.org>.
Sorry I don't see any other solution than doing the whole initialization
in pageBeginsRender and pass the (persistent) property to the component.
Le jeudi 06 janvier 2005 à 08:45 +0100, Thijs Suijten a écrit :
> Anyone??
>
> -----Original Message-----
> From: Thijs Suijten [mailto:t.suijten@semantica.nl]
> Sent: woensdag 29 december 2004 8:57
> To: Tapestry users
> Subject: RE: Persitent page properties
>
>
> I will take a look at the developers list.
>
> I agree that initialization should be done in de pageBeginRender (In the prepareForRender the page recorder is allready locked). In my case I want to do the caching/initialization in a component, this cannot be done in the pageBeginRender because the pageBeginRender is a listener. I don't know in what order the listeners are being called and this causes a problem. The model is being passed to the component by a parameter, which is initialized in the component's-parent-page pageBeginRender. Because I don't know which pageBeginRender is called first I get a NullPointerException, in my case the component's pageBeginRender is being called first and then the component's-parent-page pageBeginRender.
>
> This results not being able to do anything in the component's pageBeginRender because the model is null at that point, because the pageBeginRender is the last place I can set persitent page properties, I have a problem.
>
> I hope you understand my problem, english is not my native tongue so explaining such a complex problem is difficult...
>
> -----Original Message-----
> From: Mikaël Cluseau [mailto:nwrk@nwrk.dyndns.org]
> Sent: dinsdag 28 december 2004 20:03
> To: Tapestry users
> Subject: RE: Persitent page properties
>
>
> Le mardi 28 décembre 2004 à 10:32 +0100, Thijs Suijten a écrit :
> > I still don't get it...
> >
> > It's not a huge problem but it certainly doesn't make life easier... If I want to do some caching in the render phase to prevent StaleLinkExceptions I want to store some values in persistent page properties, I get a page-recorder-locked-error.
> >
> > So I made a Model which can contain my cached values, I initialize the Model in the pageBeginRender and use the setter to put it in the persitent page property. Now I can store my cached values in the persitent page property using: getModel().storeCache(...);
> >
> > Isn't this odd?
>
> Not sure, from my point of view everything should be done in the
> prepareForRender or something like that (setup phase) and the page
> should only renders when it is ready to (the model must be fixed).
>
> Anyway, the technical problem of cookie-based sessions cannot be solved
> without caching the full page in-memory, which can be huge and will
> cause performance losses.
>
> Tryed to answer... better ask it on the developer list to get an answer
> of Howard.
>
> > -----Original Message-----
> > From: Mikaël Cluseau [mailto:nwrk@nwrk.dyndns.org]
> > Sent: maandag 27 december 2004 3:58
> > To: Tapestry users
> > Subject: Re: Persitent page properties
> >
> >
> > Le vendredi 24 décembre 2004 à 08:55 +0100, Thijs Suijten a écrit :
> > > I've been wordking with Tapestry for quit a while now. I still haven't
> > > figured out why persitent page properties cannot be modified during the
> > > render phase. (I get a locked error)
> > >
> > > Can someone please enlighten me?
> >
> > I think this is because if you don't have a session and that the buffer
> > has been sent to the client, you can't open the session (since it is
> > cookie based): allowing a persistent property to change during the
> > render phase breaks the guarantee to have it persisted.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>
>
> --
> No virus found in this incoming message.
> Checked by AVG Anti-Virus.
> Version: 7.0.296 / Virus Database: 265.6.5 - Release Date: 26-12-2004
>
>
> --
> No virus found in this outgoing message.
> Checked by AVG Anti-Virus.
> Version: 7.0.296 / Virus Database: 265.6.5 - Release Date: 26-12-2004
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>
>
> --
> No virus found in this incoming message.
> Checked by AVG Anti-Virus.
> Version: 7.0.296 / Virus Database: 265.6.5 - Release Date: 26-12-2004
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org