You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by "IWAMURO Motonori (JIRA)" <ji...@apache.org> on 2010/04/07 17:19:33 UTC

[jira] Created: (WICKET-2827) Removed page might revive when push back-button

Removed page might revive when push back-button
-----------------------------------------------

                 Key: WICKET-2827
                 URL: https://issues.apache.org/jira/browse/WICKET-2827
             Project: Wicket
          Issue Type: Bug
          Components: wicket
    Affects Versions: 1.4.7
         Environment: Windows XP SP3 (32bit), Java 6.0 update 19, and Tomcat 6.0.20
            Reporter: IWAMURO Motonori


Hi.

The removed page might revive.
This is caused in the following conditions:
1) "getPageMap().remove(this)" or "getPageMap().remove()" on onXXX() handler. (e.g. Link#onClick())
2) Screen transition using "setResponsePage(NextPage.class)".
3) Push back-button on NextPage.
4) The removed page revive.

This cause is as follows:
a) When NextPage is displayed, the removed page remains in  "org.apache.wicket.protocol.http.SecondLevelCacheSessionStore.SecondLevelCachePageMap.lastPage".
b) When the removed page is re-displayed by back-button, SecondLevelCachePageMap.get(int, int) revive the page by lastPage.

The problem doesn't happen when use "setResponsePage(new NextPage())" instead of "setResponsePage(NextPage.class)".
Because "lastPage" is overwritten by the instance of NextPage.

It is my patch as follows:

Index: src/main/java/org/apache/wicket/protocol/http/SecondLevelCacheSessionStore.java
===================================================================
--- src/main/java/org/apache/wicket/protocol/http/SecondLevelCacheSessionStore.java	(revision 930858)
+++ src/main/java/org/apache/wicket/protocol/http/SecondLevelCacheSessionStore.java	(working copy)
@@ -348,6 +348,7 @@
 			{
 				getStore().removePage(sessionId, getName(), -1);
 			}
+			lastPage = null;
 		}
 
 		/**
@@ -361,6 +362,9 @@
 			{
 				getStore().removePage(sessionId, getName(), entry.getNumericId());
 			}
+			if (lastPage instanceof Page && ((Page) lastPage).getPageMapEntry() == entry) {
+				lastPage = null;
+			}
 		}
 
 		private IPageStore getStore()


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


[jira] Commented: (WICKET-2827) Removed page might revive when push back-button

Posted by "IWAMURO Motonori (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WICKET-2827?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12854565#action_12854565 ] 

IWAMURO Motonori commented on WICKET-2827:
------------------------------------------

Oh, my patch doesn't work for "getPageMap().remove()" ...

> Removed page might revive when push back-button
> -----------------------------------------------
>
>                 Key: WICKET-2827
>                 URL: https://issues.apache.org/jira/browse/WICKET-2827
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>    Affects Versions: 1.4.7
>         Environment: Windows XP SP3 (32bit), Java 6.0 update 19, and Tomcat 6.0.20
>            Reporter: IWAMURO Motonori
>         Attachments: expire-test.zip, removepage.patch
>
>
> Hi.
> The removed page might revive.
> This is caused in the following conditions:
> 1) "getPageMap().remove(this)" or "getPageMap().remove()" on onXXX() handler. (e.g. Link#onClick())
> 2) Screen transition using "setResponsePage(NextPage.class)".
> 3) Push back-button on NextPage.
> 4) The removed page revive.
> This cause is as follows:
> a) When NextPage is displayed, the removed page remains in  "org.apache.wicket.protocol.http.SecondLevelCacheSessionStore.SecondLevelCachePageMap.lastPage".
> b) When the removed page is re-displayed by back-button, SecondLevelCachePageMap.get(int, int) revive the page by lastPage.
> The problem doesn't happen when use "setResponsePage(new NextPage())" instead of "setResponsePage(NextPage.class)".
> Because "lastPage" is overwritten by the instance of NextPage.
> It is my patch as follows:
> Index: src/main/java/org/apache/wicket/protocol/http/SecondLevelCacheSessionStore.java
> ===================================================================
> --- src/main/java/org/apache/wicket/protocol/http/SecondLevelCacheSessionStore.java	(revision 930858)
> +++ src/main/java/org/apache/wicket/protocol/http/SecondLevelCacheSessionStore.java	(working copy)
> @@ -348,6 +348,7 @@
>  			{
>  				getStore().removePage(sessionId, getName(), -1);
>  			}
> +			lastPage = null;
>  		}
>  
>  		/**
> @@ -361,6 +362,9 @@
>  			{
>  				getStore().removePage(sessionId, getName(), entry.getNumericId());
>  			}
> +			if (lastPage instanceof Page && ((Page) lastPage).getPageMapEntry() == entry) {
> +				lastPage = null;
> +			}
>  		}
>  
>  		private IPageStore getStore()

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


[jira] Commented: (WICKET-2827) Removed page might revive when push back-button

Posted by "Hudson (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WICKET-2827?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12903138#action_12903138 ] 

Hudson commented on WICKET-2827:
--------------------------------

Integrated in Apache Wicket 1.4.x #126 (See [https://hudson.apache.org/hudson/job/Apache%20Wicket%201.4.x/126/])
    Issue: WICKET-2827


> Removed page might revive when push back-button
> -----------------------------------------------
>
>                 Key: WICKET-2827
>                 URL: https://issues.apache.org/jira/browse/WICKET-2827
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>    Affects Versions: 1.4.7
>         Environment: Windows XP SP3 (32bit), Java 6.0 update 19, and Tomcat 6.0.20
>            Reporter: IWAMURO Motonori
>            Assignee: Igor Vaynberg
>             Fix For: 1.4.11
>
>         Attachments: expire-test.zip, removepage.patch, removepage2.patch
>
>
> Hi.
> The removed page might revive.
> This is caused in the following conditions:
> 1) "getPageMap().remove(this)" or "getPageMap().remove()" on onXXX() handler. (e.g. Link#onClick())
> 2) Screen transition using "setResponsePage(NextPage.class)".
> 3) Push back-button on NextPage.
> 4) The removed page revive.
> This cause is as follows:
> a) When NextPage is displayed, the removed page remains in  "org.apache.wicket.protocol.http.SecondLevelCacheSessionStore.SecondLevelCachePageMap.lastPage".
> b) When the removed page is re-displayed by back-button, SecondLevelCachePageMap.get(int, int) revive the page by lastPage.
> The problem doesn't happen when use "setResponsePage(new NextPage())" instead of "setResponsePage(NextPage.class)".
> Because "lastPage" is overwritten by the instance of NextPage.
> It is my patch as follows:
> Index: src/main/java/org/apache/wicket/protocol/http/SecondLevelCacheSessionStore.java
> ===================================================================
> --- src/main/java/org/apache/wicket/protocol/http/SecondLevelCacheSessionStore.java	(revision 930858)
> +++ src/main/java/org/apache/wicket/protocol/http/SecondLevelCacheSessionStore.java	(working copy)
> @@ -348,6 +348,7 @@
>  			{
>  				getStore().removePage(sessionId, getName(), -1);
>  			}
> +			lastPage = null;
>  		}
>  
>  		/**
> @@ -361,6 +362,9 @@
>  			{
>  				getStore().removePage(sessionId, getName(), entry.getNumericId());
>  			}
> +			if (lastPage instanceof Page && ((Page) lastPage).getPageMapEntry() == entry) {
> +				lastPage = null;
> +			}
>  		}
>  
>  		private IPageStore getStore()

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


[jira] Resolved: (WICKET-2827) Removed page might revive when push back-button

Posted by "Igor Vaynberg (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/WICKET-2827?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Igor Vaynberg resolved WICKET-2827.
-----------------------------------

         Assignee: Igor Vaynberg
    Fix Version/s: 1.4.11
       Resolution: Fixed

> Removed page might revive when push back-button
> -----------------------------------------------
>
>                 Key: WICKET-2827
>                 URL: https://issues.apache.org/jira/browse/WICKET-2827
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>    Affects Versions: 1.4.7
>         Environment: Windows XP SP3 (32bit), Java 6.0 update 19, and Tomcat 6.0.20
>            Reporter: IWAMURO Motonori
>            Assignee: Igor Vaynberg
>             Fix For: 1.4.11
>
>         Attachments: expire-test.zip, removepage.patch, removepage2.patch
>
>
> Hi.
> The removed page might revive.
> This is caused in the following conditions:
> 1) "getPageMap().remove(this)" or "getPageMap().remove()" on onXXX() handler. (e.g. Link#onClick())
> 2) Screen transition using "setResponsePage(NextPage.class)".
> 3) Push back-button on NextPage.
> 4) The removed page revive.
> This cause is as follows:
> a) When NextPage is displayed, the removed page remains in  "org.apache.wicket.protocol.http.SecondLevelCacheSessionStore.SecondLevelCachePageMap.lastPage".
> b) When the removed page is re-displayed by back-button, SecondLevelCachePageMap.get(int, int) revive the page by lastPage.
> The problem doesn't happen when use "setResponsePage(new NextPage())" instead of "setResponsePage(NextPage.class)".
> Because "lastPage" is overwritten by the instance of NextPage.
> It is my patch as follows:
> Index: src/main/java/org/apache/wicket/protocol/http/SecondLevelCacheSessionStore.java
> ===================================================================
> --- src/main/java/org/apache/wicket/protocol/http/SecondLevelCacheSessionStore.java	(revision 930858)
> +++ src/main/java/org/apache/wicket/protocol/http/SecondLevelCacheSessionStore.java	(working copy)
> @@ -348,6 +348,7 @@
>  			{
>  				getStore().removePage(sessionId, getName(), -1);
>  			}
> +			lastPage = null;
>  		}
>  
>  		/**
> @@ -361,6 +362,9 @@
>  			{
>  				getStore().removePage(sessionId, getName(), entry.getNumericId());
>  			}
> +			if (lastPage instanceof Page && ((Page) lastPage).getPageMapEntry() == entry) {
> +				lastPage = null;
> +			}
>  		}
>  
>  		private IPageStore getStore()

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


[jira] Updated: (WICKET-2827) Removed page might revive when push back-button

Posted by "IWAMURO Motonori (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/WICKET-2827?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

IWAMURO Motonori updated WICKET-2827:
-------------------------------------

    Attachment: expire-test.zip
                removepage.patch

> Removed page might revive when push back-button
> -----------------------------------------------
>
>                 Key: WICKET-2827
>                 URL: https://issues.apache.org/jira/browse/WICKET-2827
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>    Affects Versions: 1.4.7
>         Environment: Windows XP SP3 (32bit), Java 6.0 update 19, and Tomcat 6.0.20
>            Reporter: IWAMURO Motonori
>         Attachments: expire-test.zip, removepage.patch
>
>
> Hi.
> The removed page might revive.
> This is caused in the following conditions:
> 1) "getPageMap().remove(this)" or "getPageMap().remove()" on onXXX() handler. (e.g. Link#onClick())
> 2) Screen transition using "setResponsePage(NextPage.class)".
> 3) Push back-button on NextPage.
> 4) The removed page revive.
> This cause is as follows:
> a) When NextPage is displayed, the removed page remains in  "org.apache.wicket.protocol.http.SecondLevelCacheSessionStore.SecondLevelCachePageMap.lastPage".
> b) When the removed page is re-displayed by back-button, SecondLevelCachePageMap.get(int, int) revive the page by lastPage.
> The problem doesn't happen when use "setResponsePage(new NextPage())" instead of "setResponsePage(NextPage.class)".
> Because "lastPage" is overwritten by the instance of NextPage.
> It is my patch as follows:
> Index: src/main/java/org/apache/wicket/protocol/http/SecondLevelCacheSessionStore.java
> ===================================================================
> --- src/main/java/org/apache/wicket/protocol/http/SecondLevelCacheSessionStore.java	(revision 930858)
> +++ src/main/java/org/apache/wicket/protocol/http/SecondLevelCacheSessionStore.java	(working copy)
> @@ -348,6 +348,7 @@
>  			{
>  				getStore().removePage(sessionId, getName(), -1);
>  			}
> +			lastPage = null;
>  		}
>  
>  		/**
> @@ -361,6 +362,9 @@
>  			{
>  				getStore().removePage(sessionId, getName(), entry.getNumericId());
>  			}
> +			if (lastPage instanceof Page && ((Page) lastPage).getPageMapEntry() == entry) {
> +				lastPage = null;
> +			}
>  		}
>  
>  		private IPageStore getStore()

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


[jira] Updated: (WICKET-2827) Removed page might revive when push back-button

Posted by "IWAMURO Motonori (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/WICKET-2827?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

IWAMURO Motonori updated WICKET-2827:
-------------------------------------

    Attachment: removepage2.patch

for only PageMap#remove(Page)

> Removed page might revive when push back-button
> -----------------------------------------------
>
>                 Key: WICKET-2827
>                 URL: https://issues.apache.org/jira/browse/WICKET-2827
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>    Affects Versions: 1.4.7
>         Environment: Windows XP SP3 (32bit), Java 6.0 update 19, and Tomcat 6.0.20
>            Reporter: IWAMURO Motonori
>         Attachments: expire-test.zip, removepage.patch, removepage2.patch
>
>
> Hi.
> The removed page might revive.
> This is caused in the following conditions:
> 1) "getPageMap().remove(this)" or "getPageMap().remove()" on onXXX() handler. (e.g. Link#onClick())
> 2) Screen transition using "setResponsePage(NextPage.class)".
> 3) Push back-button on NextPage.
> 4) The removed page revive.
> This cause is as follows:
> a) When NextPage is displayed, the removed page remains in  "org.apache.wicket.protocol.http.SecondLevelCacheSessionStore.SecondLevelCachePageMap.lastPage".
> b) When the removed page is re-displayed by back-button, SecondLevelCachePageMap.get(int, int) revive the page by lastPage.
> The problem doesn't happen when use "setResponsePage(new NextPage())" instead of "setResponsePage(NextPage.class)".
> Because "lastPage" is overwritten by the instance of NextPage.
> It is my patch as follows:
> Index: src/main/java/org/apache/wicket/protocol/http/SecondLevelCacheSessionStore.java
> ===================================================================
> --- src/main/java/org/apache/wicket/protocol/http/SecondLevelCacheSessionStore.java	(revision 930858)
> +++ src/main/java/org/apache/wicket/protocol/http/SecondLevelCacheSessionStore.java	(working copy)
> @@ -348,6 +348,7 @@
>  			{
>  				getStore().removePage(sessionId, getName(), -1);
>  			}
> +			lastPage = null;
>  		}
>  
>  		/**
> @@ -361,6 +362,9 @@
>  			{
>  				getStore().removePage(sessionId, getName(), entry.getNumericId());
>  			}
> +			if (lastPage instanceof Page && ((Page) lastPage).getPageMapEntry() == entry) {
> +				lastPage = null;
> +			}
>  		}
>  
>  		private IPageStore getStore()

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