You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Ciaran Wood <ci...@gamesys.co.uk> on 2008/06/12 16:03:10 UTC

Question about T5's page lifecycle - instance variables NOT being purged

I¹ve noticed on a tapestry app that we are building, that if two users on
separate machines go to the same page, the second user can see the first
users submitted details on the form. We¹re just using a Form component, a
model Object in the page class and declaring each of the properties as
Œeditor¹ components (Textfield, Checkbox etc) like so:

<t:textfield t:id="userName" t:value="member.credentials.userName"
t:validate="required,minLength=4,maxLength=16,regexp²/>

We¹re not using a beanEditForm since the Member object has nested objects
such as Credentials, Contact etc. I¹ve checked that the two users are
getting different JSESSIONIDs, so no session sharing is present. There is a
@Persist(session) annotation on the Member model object inside the page. Is
this a bug in Tapestry? I thought that Tapestry was meant to clear all
instance variables once the page returns to the pool?

Cheers for any help, I¹m completely stumped!

Ciaran Wood

RE: Question about T5's page lifecycle - instance variables NOT being purged

Posted by Cordenier Christophe <Ch...@atosorigin.com>.
For information, I think that the PersistentFieldManager is told of a modification only when you do a 'new'.
In your exemple, the Form is changing the properties of an existing bean.

The 'new' is called before the page is attached to the user request. The 'new' must be called after 'PageAttached' phase (in activation phase, in a getter method...)

-----Message d'origine-----
De : Ciaran Wood [mailto:ciaranw@gamesys.co.uk]
Envoyé : jeudi 12 juin 2008 16:42
À : Tapestry users
Objet : Re: Question about T5's page lifecycle - instance variables NOT being purged

Here's the code:

public class Register {

    @Component

    private Form registerForm;

    @Persist("session")

    private Member member;



    @PageLoaded

    void pageLoaded(){

        log.debug("member created");

        member = new Member();

        member.setCurrency("GBP");

    }
}


And in the tml:

<t:form t:id="registerForm" >

    <t:errors />

    <p>
        <t:label for="userName" /><br />
        <t:textfield t:id="userName" t:value="member.credentials.userName"
t:validate="required,minLength=4,maxLength=16,regexp" />

    </p>

    <p>

        <t:label for="password" /><br />

        <t:passwordfield t:id="password"
t:value="member.credentials.password"

t:validate="required,minLength=6,maxLength=16,regexp"/>

    </p>
</t:form>


Ciaran

On 12/06/2008 3:20pm, "Cordenier Christophe"
<Ch...@atosorigin.com> wrote:

> Actually, at the end of the request, each variable instance is set to its
> default value before giving the page instance back to the pool. Do you
> initialize the member at declaration time ?
>
> Can you us more code ?
>
>
> -----Message d'origine-----
> De : Ciaran Wood [mailto:ciaranw@gamesys.co.uk]
> Envoyé : jeudi 12 juin 2008 16:03
> À : Tapestry users
> Objet : Question about T5's page lifecycle - instance variables NOT being
> purged
>
> I¹ve noticed on a tapestry app that we are building, that if two users on
> separate machines go to the same page, the second user can see the first
> users submitted details on the form. We¹re just using a Form component, a
> model Object in the page class and declaring each of the properties as
> Œeditor¹ components (Textfield, Checkbox etc) like so:
>
> <t:textfield t:id="userName" t:value="member.credentials.userName"
> t:validate="required,minLength=4,maxLength=16,regexp²/>
>
> We¹re not using a beanEditForm since the Member object has nested objects
> such as Credentials, Contact etc. I¹ve checked that the two users are
> getting different JSESSIONIDs, so no session sharing is present. There is a
> @Persist(session) annotation on the Member model object inside the page. Is
> this a bug in Tapestry? I thought that Tapestry was meant to clear all
> instance variables once the page returns to the pool?
>
> Cheers for any help, I¹m completely stumped!
>
> Ciaran Wood
>
>
> Ce message et les pièces jointes sont confidentiels et réservés à l'usage
> exclusif de ses destinataires. Il peut également être protégé par le secret
> professionnel. Si vous recevez ce message par erreur, merci d'en avertir
> immédiatement l'expéditeur et de le détruire. L'intégrité du message ne
> pouvant être assurée sur Internet, la responsabilité du groupe Atos Origin ne
> pourra être recherchée quant au contenu de ce message. Bien que les meilleurs
> efforts soient faits pour maintenir cette transmission exempte de tout virus,
> l'expéditeur ne donne aucune garantie à cet égard et sa responsabilité ne
> saurait être recherchée pour tout dommage résultant d'un virus transmis.
>
> This e-mail and the documents attached are confidential and intended solely
> for the addressee; it may also be privileged. If you receive this e-mail in
> error, please notify the sender immediately and destroy it. As its integrity
> cannot be secured on the Internet, the Atos Origin group liability cannot be
> triggered for the message content. Although the sender endeavours to maintain
> a computer virus-free network, the sender does not warrant that this
> transmission is virus-free and will not be liable for any damages resulting
> from any virus transmitted.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org




Ce message et les pièces jointes sont confidentiels et réservés à l'usage exclusif de ses destinataires. Il peut également être protégé par le secret professionnel. Si vous recevez ce message par erreur, merci d'en avertir immédiatement l'expéditeur et de le détruire. L'intégrité du message ne pouvant être assurée sur Internet, la responsabilité du groupe Atos Origin ne pourra être recherchée quant au contenu de ce message. Bien que les meilleurs efforts soient faits pour maintenir cette transmission exempte de tout virus, l'expéditeur ne donne aucune garantie à cet égard et sa responsabilité ne saurait être recherchée pour tout dommage résultant d'un virus transmis.

This e-mail and the documents attached are confidential and intended solely for the addressee; it may also be privileged. If you receive this e-mail in error, please notify the sender immediately and destroy it. As its integrity cannot be secured on the Internet, the Atos Origin group liability cannot be triggered for the message content. Although the sender endeavours to maintain a computer virus-free network, the sender does not warrant that this transmission is virus-free and will not be liable for any damages resulting from any virus transmitted.

Re: Question about T5's page lifecycle - instance variables NOT being purged

Posted by Ciaran Wood <ci...@gamesys.co.uk>.
Excellent, that solved the problem. Thanks very much!

Ciaran


On 12/06/2008 3:52pm, "Cordenier Christophe"
<Ch...@atosorigin.com> wrote:

> @OnEvent("activate")


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


RE: Question about T5's page lifecycle - instance variables NOT being purged

Posted by Cordenier Christophe <Ch...@atosorigin.com>.
PageLoaded is executed only once during the page pool instance creation.
I Think it's the same as setting a default value to your member variable, and then the Form may always work on the same instance.

Can you try something like this :

    @OnEvent("activate")
    void pageLoaded(){

        log.debug("member created");

        if(member == null) {
          member = new Member();
          member.setCurrency("GBP");
        }

    }

instead of using PageLoaded phase.


Christophe.

-----Message d'origine-----
De : Ciaran Wood [mailto:ciaranw@gamesys.co.uk]
Envoyé : jeudi 12 juin 2008 16:42
À : Tapestry users
Objet : Re: Question about T5's page lifecycle - instance variables NOT being purged

Here's the code:

public class Register {

    @Component

    private Form registerForm;

    @Persist("session")

    private Member member;



    @PageLoaded

    void pageLoaded(){

        log.debug("member created");

        member = new Member();

        member.setCurrency("GBP");

    }
}


And in the tml:

<t:form t:id="registerForm" >

    <t:errors />

    <p>
        <t:label for="userName" /><br />
        <t:textfield t:id="userName" t:value="member.credentials.userName"
t:validate="required,minLength=4,maxLength=16,regexp" />

    </p>

    <p>

        <t:label for="password" /><br />

        <t:passwordfield t:id="password"
t:value="member.credentials.password"

t:validate="required,minLength=6,maxLength=16,regexp"/>

    </p>
</t:form>


Ciaran

On 12/06/2008 3:20pm, "Cordenier Christophe"
<Ch...@atosorigin.com> wrote:

> Actually, at the end of the request, each variable instance is set to its
> default value before giving the page instance back to the pool. Do you
> initialize the member at declaration time ?
>
> Can you us more code ?
>
>
> -----Message d'origine-----
> De : Ciaran Wood [mailto:ciaranw@gamesys.co.uk]
> Envoyé : jeudi 12 juin 2008 16:03
> À : Tapestry users
> Objet : Question about T5's page lifecycle - instance variables NOT being
> purged
>
> I¹ve noticed on a tapestry app that we are building, that if two users on
> separate machines go to the same page, the second user can see the first
> users submitted details on the form. We¹re just using a Form component, a
> model Object in the page class and declaring each of the properties as
> Œeditor¹ components (Textfield, Checkbox etc) like so:
>
> <t:textfield t:id="userName" t:value="member.credentials.userName"
> t:validate="required,minLength=4,maxLength=16,regexp²/>
>
> We¹re not using a beanEditForm since the Member object has nested objects
> such as Credentials, Contact etc. I¹ve checked that the two users are
> getting different JSESSIONIDs, so no session sharing is present. There is a
> @Persist(session) annotation on the Member model object inside the page. Is
> this a bug in Tapestry? I thought that Tapestry was meant to clear all
> instance variables once the page returns to the pool?
>
> Cheers for any help, I¹m completely stumped!
>
> Ciaran Wood
>
>
> Ce message et les pièces jointes sont confidentiels et réservés à l'usage
> exclusif de ses destinataires. Il peut également être protégé par le secret
> professionnel. Si vous recevez ce message par erreur, merci d'en avertir
> immédiatement l'expéditeur et de le détruire. L'intégrité du message ne
> pouvant être assurée sur Internet, la responsabilité du groupe Atos Origin ne
> pourra être recherchée quant au contenu de ce message. Bien que les meilleurs
> efforts soient faits pour maintenir cette transmission exempte de tout virus,
> l'expéditeur ne donne aucune garantie à cet égard et sa responsabilité ne
> saurait être recherchée pour tout dommage résultant d'un virus transmis.
>
> This e-mail and the documents attached are confidential and intended solely
> for the addressee; it may also be privileged. If you receive this e-mail in
> error, please notify the sender immediately and destroy it. As its integrity
> cannot be secured on the Internet, the Atos Origin group liability cannot be
> triggered for the message content. Although the sender endeavours to maintain
> a computer virus-free network, the sender does not warrant that this
> transmission is virus-free and will not be liable for any damages resulting
> from any virus transmitted.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org




Ce message et les pièces jointes sont confidentiels et réservés à l'usage exclusif de ses destinataires. Il peut également être protégé par le secret professionnel. Si vous recevez ce message par erreur, merci d'en avertir immédiatement l'expéditeur et de le détruire. L'intégrité du message ne pouvant être assurée sur Internet, la responsabilité du groupe Atos Origin ne pourra être recherchée quant au contenu de ce message. Bien que les meilleurs efforts soient faits pour maintenir cette transmission exempte de tout virus, l'expéditeur ne donne aucune garantie à cet égard et sa responsabilité ne saurait être recherchée pour tout dommage résultant d'un virus transmis.

This e-mail and the documents attached are confidential and intended solely for the addressee; it may also be privileged. If you receive this e-mail in error, please notify the sender immediately and destroy it. As its integrity cannot be secured on the Internet, the Atos Origin group liability cannot be triggered for the message content. Although the sender endeavours to maintain a computer virus-free network, the sender does not warrant that this transmission is virus-free and will not be liable for any damages resulting from any virus transmitted.

Re: Question about T5's page lifecycle - instance variables NOT being purged

Posted by Ciaran Wood <ci...@gamesys.co.uk>.
Here's the code:

public class Register {

    @Component
    
    private Form registerForm;

    @Persist("session")

    private Member member;
    


    @PageLoaded
   
    void pageLoaded(){

        log.debug("member created");

        member = new Member();

        member.setCurrency("GBP");

    }
}


And in the tml:

<t:form t:id="registerForm" >

    <t:errors />
  
    <p>
        <t:label for="userName" /><br />
        <t:textfield t:id="userName" t:value="member.credentials.userName" 
t:validate="required,minLength=4,maxLength=16,regexp" />

    </p>
          
    <p>
           
        <t:label for="password" /><br />

        <t:passwordfield t:id="password"
t:value="member.credentials.password" 

t:validate="required,minLength=6,maxLength=16,regexp"/>

    </p>
</t:form>


Ciaran

On 12/06/2008 3:20pm, "Cordenier Christophe"
<Ch...@atosorigin.com> wrote:

> Actually, at the end of the request, each variable instance is set to its
> default value before giving the page instance back to the pool. Do you
> initialize the member at declaration time ?
> 
> Can you us more code ?
> 
> 
> -----Message d'origine-----
> De : Ciaran Wood [mailto:ciaranw@gamesys.co.uk]
> Envoyé : jeudi 12 juin 2008 16:03
> À : Tapestry users
> Objet : Question about T5's page lifecycle - instance variables NOT being
> purged
> 
> I¹ve noticed on a tapestry app that we are building, that if two users on
> separate machines go to the same page, the second user can see the first
> users submitted details on the form. We¹re just using a Form component, a
> model Object in the page class and declaring each of the properties as
> Œeditor¹ components (Textfield, Checkbox etc) like so:
> 
> <t:textfield t:id="userName" t:value="member.credentials.userName"
> t:validate="required,minLength=4,maxLength=16,regexp²/>
> 
> We¹re not using a beanEditForm since the Member object has nested objects
> such as Credentials, Contact etc. I¹ve checked that the two users are
> getting different JSESSIONIDs, so no session sharing is present. There is a
> @Persist(session) annotation on the Member model object inside the page. Is
> this a bug in Tapestry? I thought that Tapestry was meant to clear all
> instance variables once the page returns to the pool?
> 
> Cheers for any help, I¹m completely stumped!
> 
> Ciaran Wood
> 
> 
> Ce message et les pièces jointes sont confidentiels et réservés à l'usage
> exclusif de ses destinataires. Il peut également être protégé par le secret
> professionnel. Si vous recevez ce message par erreur, merci d'en avertir
> immédiatement l'expéditeur et de le détruire. L'intégrité du message ne
> pouvant être assurée sur Internet, la responsabilité du groupe Atos Origin ne
> pourra être recherchée quant au contenu de ce message. Bien que les meilleurs
> efforts soient faits pour maintenir cette transmission exempte de tout virus,
> l'expéditeur ne donne aucune garantie à cet égard et sa responsabilité ne
> saurait être recherchée pour tout dommage résultant d'un virus transmis.
> 
> This e-mail and the documents attached are confidential and intended solely
> for the addressee; it may also be privileged. If you receive this e-mail in
> error, please notify the sender immediately and destroy it. As its integrity
> cannot be secured on the Internet, the Atos Origin group liability cannot be
> triggered for the message content. Although the sender endeavours to maintain
> a computer virus-free network, the sender does not warrant that this
> transmission is virus-free and will not be liable for any damages resulting
> from any virus transmitted.
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


RE: Question about T5's page lifecycle - instance variables NOT being purged

Posted by Cordenier Christophe <Ch...@atosorigin.com>.
Actually, at the end of the request, each variable instance is set to its default value before giving the page instance back to the pool. Do you initialize the member at declaration time ?

Can you us more code ?


-----Message d'origine-----
De : Ciaran Wood [mailto:ciaranw@gamesys.co.uk]
Envoyé : jeudi 12 juin 2008 16:03
À : Tapestry users
Objet : Question about T5's page lifecycle - instance variables NOT being purged

I¹ve noticed on a tapestry app that we are building, that if two users on
separate machines go to the same page, the second user can see the first
users submitted details on the form. We¹re just using a Form component, a
model Object in the page class and declaring each of the properties as
Œeditor¹ components (Textfield, Checkbox etc) like so:

<t:textfield t:id="userName" t:value="member.credentials.userName"
t:validate="required,minLength=4,maxLength=16,regexp²/>

We¹re not using a beanEditForm since the Member object has nested objects
such as Credentials, Contact etc. I¹ve checked that the two users are
getting different JSESSIONIDs, so no session sharing is present. There is a
@Persist(session) annotation on the Member model object inside the page. Is
this a bug in Tapestry? I thought that Tapestry was meant to clear all
instance variables once the page returns to the pool?

Cheers for any help, I¹m completely stumped!

Ciaran Wood


Ce message et les pièces jointes sont confidentiels et réservés à l'usage exclusif de ses destinataires. Il peut également être protégé par le secret professionnel. Si vous recevez ce message par erreur, merci d'en avertir immédiatement l'expéditeur et de le détruire. L'intégrité du message ne pouvant être assurée sur Internet, la responsabilité du groupe Atos Origin ne pourra être recherchée quant au contenu de ce message. Bien que les meilleurs efforts soient faits pour maintenir cette transmission exempte de tout virus, l'expéditeur ne donne aucune garantie à cet égard et sa responsabilité ne saurait être recherchée pour tout dommage résultant d'un virus transmis.

This e-mail and the documents attached are confidential and intended solely for the addressee; it may also be privileged. If you receive this e-mail in error, please notify the sender immediately and destroy it. As its integrity cannot be secured on the Internet, the Atos Origin group liability cannot be triggered for the message content. Although the sender endeavours to maintain a computer virus-free network, the sender does not warrant that this transmission is virus-free and will not be liable for any damages resulting from any virus transmitted.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


RE: Question about T5's page lifecycle - instance variables NOT being purged

Posted by Kristian Marinkovic <kr...@porsche.co.at>.
could you post the source of your page and template?
are you using https? http <-> https switches?

we're already using T5 in production and never had this issues

g,
kris




Ciaran Wood <ci...@gamesys.co.uk> 
12.06.2008 16:03
Bitte antworten an
"Tapestry users" <us...@tapestry.apache.org>


An
Tapestry users <us...@tapestry.apache.org>
Kopie

Thema
Question about T5's page lifecycle - instance variables NOT being purged






I¹ve noticed on a tapestry app that we are building, that if two users on
separate machines go to the same page, the second user can see the first
users submitted details on the form. We¹re just using a Form component, a
model Object in the page class and declaring each of the properties as
Œeditor¹ components (Textfield, Checkbox etc) like so:

<t:textfield t:id="userName" t:value="member.credentials.userName"
t:validate="required,minLength=4,maxLength=16,regexp²/>

We¹re not using a beanEditForm since the Member object has nested objects
such as Credentials, Contact etc. I¹ve checked that the two users are
getting different JSESSIONIDs, so no session sharing is present. There is 
a
@Persist(session) annotation on the Member model object inside the page. 
Is
this a bug in Tapestry? I thought that Tapestry was meant to clear all
instance variables once the page returns to the pool?

Cheers for any help, I¹m completely stumped!

Ciaran Wood