You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tapestry.apache.org by "Hugo Palma (JIRA)" <de...@tapestry.apache.org> on 2007/10/21 04:42:50 UTC

[jira] Created: (TAPESTRY-1846) Page fields not getting cleaned up in pool

Page fields not getting cleaned up in pool
------------------------------------------

                 Key: TAPESTRY-1846
                 URL: https://issues.apache.org/jira/browse/TAPESTRY-1846
             Project: Tapestry
          Issue Type: Bug
          Components: tapestry-core
    Affects Versions: 5.0.6
            Reporter: Hugo Palma


Here's my use case that shows the problem.
I have a page class with the following field:

private MyBean _myBean = new MyBean("default");

where MyBean is a simple class like:

public class MyBean {

    private String _value;

    public MyBean(String value){

        _value = value;
    }

    public String getValue() {
        return _value;
    }

    public void setValue(String value) {
        _value = value;
    }
}

In the page class i have this meta annotation:

@Meta({"tapestry.persistence-strategy=flash"})


In my page template i have this textfield inside a form:

<t:textfield value="myBean.value"/>


So, the expected behaviour would be for the textfield value to be reset to "default" when i refreshed the page after it rendered just like any other normal textfield. But no, after i submit the form once this textfield will always have the submited value and it will never again reset to the default value. All other fields on the same page reset to their default values, this one doesn't.
The only difference between this field and the other fields is that the other fields access the property directly while this access the property though a bean.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


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


[jira] Closed: (TAPESTRY-1846) Page fields not getting cleaned up in pool

Posted by "Howard M. Lewis Ship (JIRA)" <de...@tapestry.apache.org>.
     [ https://issues.apache.org/jira/browse/TAPESTRY-1846?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Howard M. Lewis Ship closed TAPESTRY-1846.
------------------------------------------

    Resolution: Invalid
      Assignee: Howard M. Lewis Ship

Tapestry is doing what it should do: holding the *reference* to the object you provide.

Your suggested solution, keeping a serialized copy, is a significant change and would be a new feature, rather than a bug fix.

> Page fields not getting cleaned up in pool
> ------------------------------------------
>
>                 Key: TAPESTRY-1846
>                 URL: https://issues.apache.org/jira/browse/TAPESTRY-1846
>             Project: Tapestry
>          Issue Type: Bug
>          Components: tapestry-core
>    Affects Versions: 5.0.6
>            Reporter: Hugo Palma
>            Assignee: Howard M. Lewis Ship
>
> Here's my use case that shows the problem.
> I have a page class with the following field:
> private MyBean _myBean = new MyBean("default");
> where MyBean is a simple class like:
> public class MyBean {
>     private String _value;
>     public MyBean(String value){
>         _value = value;
>     }
>     public String getValue() {
>         return _value;
>     }
>     public void setValue(String value) {
>         _value = value;
>     }
> }
> In the page class i have this meta annotation:
> @Meta({"tapestry.persistence-strategy=flash"})
> In my page template i have this textfield inside a form:
> <t:textfield value="myBean.value"/>
> So, the expected behaviour would be for the textfield value to be reset to "default" when i refreshed the page after it rendered just like any other normal textfield. But no, after i submit the form once this textfield will always have the submited value and it will never again reset to the default value. All other fields on the same page reset to their default values, this one doesn't.
> The only difference between this field and the other fields is that the other fields access the property directly while this access the property though a bean.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


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


[jira] Commented: (TAPESTRY-1846) Page fields not getting cleaned up in pool

Posted by "Hugo Palma (JIRA)" <de...@tapestry.apache.org>.
    [ https://issues.apache.org/jira/browse/TAPESTRY-1846?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12551764 ] 

Hugo Palma commented on TAPESTRY-1846:
--------------------------------------

Yes, i agree that this should be considered as a new feature.
I'll create the issue as i think the described semantics would be very useful.

> Page fields not getting cleaned up in pool
> ------------------------------------------
>
>                 Key: TAPESTRY-1846
>                 URL: https://issues.apache.org/jira/browse/TAPESTRY-1846
>             Project: Tapestry
>          Issue Type: Bug
>          Components: tapestry-core
>    Affects Versions: 5.0.6
>            Reporter: Hugo Palma
>            Assignee: Howard M. Lewis Ship
>
> Here's my use case that shows the problem.
> I have a page class with the following field:
> private MyBean _myBean = new MyBean("default");
> where MyBean is a simple class like:
> public class MyBean {
>     private String _value;
>     public MyBean(String value){
>         _value = value;
>     }
>     public String getValue() {
>         return _value;
>     }
>     public void setValue(String value) {
>         _value = value;
>     }
> }
> In the page class i have this meta annotation:
> @Meta({"tapestry.persistence-strategy=flash"})
> In my page template i have this textfield inside a form:
> <t:textfield value="myBean.value"/>
> So, the expected behaviour would be for the textfield value to be reset to "default" when i refreshed the page after it rendered just like any other normal textfield. But no, after i submit the form once this textfield will always have the submited value and it will never again reset to the default value. All other fields on the same page reset to their default values, this one doesn't.
> The only difference between this field and the other fields is that the other fields access the property directly while this access the property though a bean.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


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


[jira] Commented: (TAPESTRY-1846) Page fields not getting cleaned up in pool

Posted by "Hugo Palma (JIRA)" <de...@tapestry.apache.org>.
    [ https://issues.apache.org/jira/browse/TAPESTRY-1846?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12536521 ] 

Hugo Palma commented on TAPESTRY-1846:
--------------------------------------

I do have the @Persist annotation on field _myBean, sorry.

I was thinking, the value of _myBean is reset to it's default value after the flash persister removes the value from the session. This default value is kept by tapestry right ? In this case it would be the MyBean reference.
So, this means that as Tapestry is holding a reference to the MyBean instance that is used to initialize the property then that same instance is also getting updated by the page. When Tapestry resets the property to it's default value it's actually providing the already changed instance. I'm not sure if i'm making sense here but if i am maybe this is the cause of the problem and i guess the solution would be for Tapestry to hold the default value in a serialized form instead of the object itself.

> Page fields not getting cleaned up in pool
> ------------------------------------------
>
>                 Key: TAPESTRY-1846
>                 URL: https://issues.apache.org/jira/browse/TAPESTRY-1846
>             Project: Tapestry
>          Issue Type: Bug
>          Components: tapestry-core
>    Affects Versions: 5.0.6
>            Reporter: Hugo Palma
>
> Here's my use case that shows the problem.
> I have a page class with the following field:
> private MyBean _myBean = new MyBean("default");
> where MyBean is a simple class like:
> public class MyBean {
>     private String _value;
>     public MyBean(String value){
>         _value = value;
>     }
>     public String getValue() {
>         return _value;
>     }
>     public void setValue(String value) {
>         _value = value;
>     }
> }
> In the page class i have this meta annotation:
> @Meta({"tapestry.persistence-strategy=flash"})
> In my page template i have this textfield inside a form:
> <t:textfield value="myBean.value"/>
> So, the expected behaviour would be for the textfield value to be reset to "default" when i refreshed the page after it rendered just like any other normal textfield. But no, after i submit the form once this textfield will always have the submited value and it will never again reset to the default value. All other fields on the same page reset to their default values, this one doesn't.
> The only difference between this field and the other fields is that the other fields access the property directly while this access the property though a bean.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


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


[jira] Commented: (TAPESTRY-1846) Page fields not getting cleaned up in pool

Posted by "Howard M. Lewis Ship (JIRA)" <de...@tapestry.apache.org>.
    [ https://issues.apache.org/jira/browse/TAPESTRY-1846?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12536512 ] 

Howard M. Lewis Ship commented on TAPESTRY-1846:
------------------------------------------------

You do have a @Persist annotation on field _myBean, right?

If not, the field is not persistent.  You've set a default value (an instance of MyBean) and that value is used to reset the field value at the end of the request.


> Page fields not getting cleaned up in pool
> ------------------------------------------
>
>                 Key: TAPESTRY-1846
>                 URL: https://issues.apache.org/jira/browse/TAPESTRY-1846
>             Project: Tapestry
>          Issue Type: Bug
>          Components: tapestry-core
>    Affects Versions: 5.0.6
>            Reporter: Hugo Palma
>
> Here's my use case that shows the problem.
> I have a page class with the following field:
> private MyBean _myBean = new MyBean("default");
> where MyBean is a simple class like:
> public class MyBean {
>     private String _value;
>     public MyBean(String value){
>         _value = value;
>     }
>     public String getValue() {
>         return _value;
>     }
>     public void setValue(String value) {
>         _value = value;
>     }
> }
> In the page class i have this meta annotation:
> @Meta({"tapestry.persistence-strategy=flash"})
> In my page template i have this textfield inside a form:
> <t:textfield value="myBean.value"/>
> So, the expected behaviour would be for the textfield value to be reset to "default" when i refreshed the page after it rendered just like any other normal textfield. But no, after i submit the form once this textfield will always have the submited value and it will never again reset to the default value. All other fields on the same page reset to their default values, this one doesn't.
> The only difference between this field and the other fields is that the other fields access the property directly while this access the property though a bean.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


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