You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tapestry.apache.org by "Adam Greene (JIRA)" <ta...@jakarta.apache.org> on 2005/08/03 06:35:35 UTC

[jira] Created: (TAPESTRY-524) Problems with Client Side Persistence

Problems with Client Side Persistence
-------------------------------------

         Key: TAPESTRY-524
         URL: http://issues.apache.org/jira/browse/TAPESTRY-524
     Project: Tapestry
        Type: Bug
  Components: Framework  
    Versions: 4.0    
 Environment: Tapestry 3.0 Beta 3
    Reporter: Adam Greene


    public void initializeService()
    {
        List names = _request.getParameterNames();
        Iterator i = names.iterator();
        while (i.hasNext())
        {
            String name = (String) i.next();

            if (!name.startsWith(PREFIX))
                continue;

            // At this point we need to validate the parameter against what type of persistent strategy this is, we are blindly grabbing page persistence,even
            // when the strategy is application.

            String pageName = name.substring(PREFIX.length());
            String encoded = _request.getParameterValue(name);

            PersistentPropertyData data = new PersistentPropertyData(_encoder);
            data.storeEncoded(encoded);

            _data.put(pageName, data);
        }

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


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


[jira] Commented: (TAPESTRY-524) Problems with Client Side Persistence

Posted by "Howard M. Lewis Ship (JIRA)" <ta...@jakarta.apache.org>.
    [ http://issues.apache.org/jira/browse/TAPESTRY-524?page=comments#action_12317682 ] 

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

Much easier for me if the patch is in the form of ... a CVS patch.

> Problems with Client Side Persistence
> -------------------------------------
>
>          Key: TAPESTRY-524
>          URL: http://issues.apache.org/jira/browse/TAPESTRY-524
>      Project: Tapestry
>         Type: Bug
>   Components: Framework
>     Versions: 4.0
>  Environment: Tapestry 3.0 Beta 3
>     Reporter: Adam Greene
>     Assignee: Howard M. Lewis Ship
>  Attachments: recordfix.zip
>
>     public void initializeService()
>     {
>         List names = _request.getParameterNames();
>         Iterator i = names.iterator();
>         while (i.hasNext())
>         {
>             String name = (String) i.next();
>             if (!name.startsWith(PREFIX))
>                 continue;
>             // At this point we need to validate the parameter against what type of persistent strategy this is, we are blindly grabbing page persistence,even
>             // when the strategy is application.
>             String pageName = name.substring(PREFIX.length());
>             String encoded = _request.getParameterValue(name);
>             PersistentPropertyData data = new PersistentPropertyData(_encoder);
>             data.storeEncoded(encoded);
>             _data.put(pageName, data);
>         }

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


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


[jira] Updated: (TAPESTRY-524) Client Side Persistence Scopes can conflict with each other

Posted by "Howard M. Lewis Ship (JIRA)" <ta...@jakarta.apache.org>.
     [ http://issues.apache.org/jira/browse/TAPESTRY-524?page=all ]

Howard M. Lewis Ship updated TAPESTRY-524:
------------------------------------------

    Summary: Client Side Persistence Scopes can conflict with each other  (was: Problems with Client Side Persistence)

> Client Side Persistence Scopes can conflict with each other
> -----------------------------------------------------------
>
>          Key: TAPESTRY-524
>          URL: http://issues.apache.org/jira/browse/TAPESTRY-524
>      Project: Tapestry
>         Type: Bug
>   Components: Framework
>     Versions: 4.0
>  Environment: Tapestry 3.0 Beta 3
>     Reporter: Adam Greene
>     Assignee: Howard M. Lewis Ship
>  Attachments: recordfix.zip
>
>     public void initializeService()
>     {
>         List names = _request.getParameterNames();
>         Iterator i = names.iterator();
>         while (i.hasNext())
>         {
>             String name = (String) i.next();
>             if (!name.startsWith(PREFIX))
>                 continue;
>             // At this point we need to validate the parameter against what type of persistent strategy this is, we are blindly grabbing page persistence,even
>             // when the strategy is application.
>             String pageName = name.substring(PREFIX.length());
>             String encoded = _request.getParameterValue(name);
>             PersistentPropertyData data = new PersistentPropertyData(_encoder);
>             data.storeEncoded(encoded);
>             _data.put(pageName, data);
>         }

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


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


[jira] Closed: (TAPESTRY-524) Client Side Persistence Scopes can conflict with each other

Posted by "Howard M. Lewis Ship (JIRA)" <ta...@jakarta.apache.org>.
     [ http://issues.apache.org/jira/browse/TAPESTRY-524?page=all ]
     
Howard M. Lewis Ship closed TAPESTRY-524:
-----------------------------------------

    Fix Version: 4.0
     Resolution: Fixed

> Client Side Persistence Scopes can conflict with each other
> -----------------------------------------------------------
>
>          Key: TAPESTRY-524
>          URL: http://issues.apache.org/jira/browse/TAPESTRY-524
>      Project: Tapestry
>         Type: Bug
>   Components: Framework
>     Versions: 4.0
>  Environment: Tapestry 3.0 Beta 3
>     Reporter: Adam Greene
>     Assignee: Howard M. Lewis Ship
>      Fix For: 4.0
>  Attachments: recordfix.zip
>
>     public void initializeService()
>     {
>         List names = _request.getParameterNames();
>         Iterator i = names.iterator();
>         while (i.hasNext())
>         {
>             String name = (String) i.next();
>             if (!name.startsWith(PREFIX))
>                 continue;
>             // At this point we need to validate the parameter against what type of persistent strategy this is, we are blindly grabbing page persistence,even
>             // when the strategy is application.
>             String pageName = name.substring(PREFIX.length());
>             String encoded = _request.getParameterValue(name);
>             PersistentPropertyData data = new PersistentPropertyData(_encoder);
>             data.storeEncoded(encoded);
>             _data.put(pageName, data);
>         }

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


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


[jira] Commented: (TAPESTRY-524) Problems with Client Side Persistence

Posted by "Kent Tong (JIRA)" <ta...@jakarta.apache.org>.
    [ http://issues.apache.org/jira/browse/TAPESTRY-524?page=comments#action_12317487 ] 

Kent Tong commented on TAPESTRY-524:
------------------------------------

You have found the issue that I reported (see http://issues.apache.org/jira/browse/TAPESTRY-411)

> Problems with Client Side Persistence
> -------------------------------------
>
>          Key: TAPESTRY-524
>          URL: http://issues.apache.org/jira/browse/TAPESTRY-524
>      Project: Tapestry
>         Type: Bug
>   Components: Framework
>     Versions: 4.0
>  Environment: Tapestry 3.0 Beta 3
>     Reporter: Adam Greene
>  Attachments: recordfix.zip
>
>     public void initializeService()
>     {
>         List names = _request.getParameterNames();
>         Iterator i = names.iterator();
>         while (i.hasNext())
>         {
>             String name = (String) i.next();
>             if (!name.startsWith(PREFIX))
>                 continue;
>             // At this point we need to validate the parameter against what type of persistent strategy this is, we are blindly grabbing page persistence,even
>             // when the strategy is application.
>             String pageName = name.substring(PREFIX.length());
>             String encoded = _request.getParameterValue(name);
>             PersistentPropertyData data = new PersistentPropertyData(_encoder);
>             data.storeEncoded(encoded);
>             _data.put(pageName, data);
>         }

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


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


[jira] Assigned: (TAPESTRY-524) Problems with Client Side Persistence

Posted by "Howard M. Lewis Ship (JIRA)" <ta...@jakarta.apache.org>.
     [ http://issues.apache.org/jira/browse/TAPESTRY-524?page=all ]

Howard M. Lewis Ship reassigned TAPESTRY-524:
---------------------------------------------

    Assign To: Howard M. Lewis Ship

> Problems with Client Side Persistence
> -------------------------------------
>
>          Key: TAPESTRY-524
>          URL: http://issues.apache.org/jira/browse/TAPESTRY-524
>      Project: Tapestry
>         Type: Bug
>   Components: Framework
>     Versions: 4.0
>  Environment: Tapestry 3.0 Beta 3
>     Reporter: Adam Greene
>     Assignee: Howard M. Lewis Ship
>  Attachments: recordfix.zip
>
>     public void initializeService()
>     {
>         List names = _request.getParameterNames();
>         Iterator i = names.iterator();
>         while (i.hasNext())
>         {
>             String name = (String) i.next();
>             if (!name.startsWith(PREFIX))
>                 continue;
>             // At this point we need to validate the parameter against what type of persistent strategy this is, we are blindly grabbing page persistence,even
>             // when the strategy is application.
>             String pageName = name.substring(PREFIX.length());
>             String encoded = _request.getParameterValue(name);
>             PersistentPropertyData data = new PersistentPropertyData(_encoder);
>             data.storeEncoded(encoded);
>             _data.put(pageName, data);
>         }

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


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


[jira] Commented: (TAPESTRY-524) Problems with Client Side Persistence

Posted by "Adam Greene (JIRA)" <ta...@jakarta.apache.org>.
    [ http://issues.apache.org/jira/browse/TAPESTRY-524?page=comments#action_12317475 ] 

Adam Greene commented on TAPESTRY-524:
--------------------------------------

I just realized I never really explained the original problem that led me to making these fixes.  The problem is this:

Given a Home.html with this in it:

    <span jwcid="@Insert" value="clientValue"/><BR>
    <span jwcid="@PageLink" page="Homek">HOME</span>
    <span jwcid="@DirectLink" listener="doAdd">Add</span>

and the Home.java as:

	@Persist(value="client")
	public abstract int getClientValue();
	public abstract void setClientValue(int what);

clicking on the Add link once, causes clientValue to become 1, click it again, it becomes 2.  Click it three times and it remains 2.  The reason was that the AppClientPropertyPersistStrategy was picking up the original value and the ClientPropertyPersistStrategy was also picking it up, but was being modified by the doAdd Direct (which simply did setClientValue(getClientValue() + 1))  and when it went to write the persistent value back out, the original value from the AppClientPropertyPersistStrategy was being used.

> Problems with Client Side Persistence
> -------------------------------------
>
>          Key: TAPESTRY-524
>          URL: http://issues.apache.org/jira/browse/TAPESTRY-524
>      Project: Tapestry
>         Type: Bug
>   Components: Framework
>     Versions: 4.0
>  Environment: Tapestry 3.0 Beta 3
>     Reporter: Adam Greene
>  Attachments: recordfix.zip
>
>     public void initializeService()
>     {
>         List names = _request.getParameterNames();
>         Iterator i = names.iterator();
>         while (i.hasNext())
>         {
>             String name = (String) i.next();
>             if (!name.startsWith(PREFIX))
>                 continue;
>             // At this point we need to validate the parameter against what type of persistent strategy this is, we are blindly grabbing page persistence,even
>             // when the strategy is application.
>             String pageName = name.substring(PREFIX.length());
>             String encoded = _request.getParameterValue(name);
>             PersistentPropertyData data = new PersistentPropertyData(_encoder);
>             data.storeEncoded(encoded);
>             _data.put(pageName, data);
>         }

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


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


[jira] Updated: (TAPESTRY-524) Problems with Client Side Persistence

Posted by "Adam Greene (JIRA)" <ta...@jakarta.apache.org>.
     [ http://issues.apache.org/jira/browse/TAPESTRY-524?page=all ]

Adam Greene updated TAPESTRY-524:
---------------------------------

    Attachment: recordfix.zip

I brutalized the Client side persistence code to make it work.  I'm sure there is a better way of doing it, but it at least works.  I submit it for review.

> Problems with Client Side Persistence
> -------------------------------------
>
>          Key: TAPESTRY-524
>          URL: http://issues.apache.org/jira/browse/TAPESTRY-524
>      Project: Tapestry
>         Type: Bug
>   Components: Framework
>     Versions: 4.0
>  Environment: Tapestry 3.0 Beta 3
>     Reporter: Adam Greene
>  Attachments: recordfix.zip
>
>     public void initializeService()
>     {
>         List names = _request.getParameterNames();
>         Iterator i = names.iterator();
>         while (i.hasNext())
>         {
>             String name = (String) i.next();
>             if (!name.startsWith(PREFIX))
>                 continue;
>             // At this point we need to validate the parameter against what type of persistent strategy this is, we are blindly grabbing page persistence,even
>             // when the strategy is application.
>             String pageName = name.substring(PREFIX.length());
>             String encoded = _request.getParameterValue(name);
>             PersistentPropertyData data = new PersistentPropertyData(_encoder);
>             data.storeEncoded(encoded);
>             _data.put(pageName, data);
>         }

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


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