You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by "Tsutomu YANO (Created) (JIRA)" <ji...@apache.org> on 2012/03/06 11:02:58 UTC

[jira] [Created] (WICKET-4441) PageProvider should

PageProvider should 
--------------------

                 Key: WICKET-4441
                 URL: https://issues.apache.org/jira/browse/WICKET-4441
             Project: Wicket
          Issue Type: Bug
            Reporter: Tsutomu YANO




--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (WICKET-4441) PageProvider should create a new Page instance if PageParameters are changed, even if a stored page exists.

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

Tsutomu YANO commented on WICKET-4441:
--------------------------------------

Does my understanding of this issue right? My understanding is following.

If users access a page through a url like /wicket/page?0, PageInstanceMapper try to restore the page from pageStore with the pageId. In this time, the PageParameter passed to a PageProvider is empty, so checking equality of PageParameters fail and new instance of page is created always. In this case, some events which use url like '/wicket/page?0' do not act correctly because new Page instance is created always though events must be post-backed into the same page rendered before events.

So, I propose that PageProvider class should have a new constructor argument like 'isPageMountedToUrl'. MountedMapper and other same kind of Mappers should pass 'true' for the argument, because a page is mounted onto a URL defined by programmer. PageInstanceMapper should pass 'false', because the url which PageInstanceMapper handle is not user-defined mount-url.

For API-compatibility, PageProvider must have all old (original) constructors. These constructors should set 'true' to the value of 'isPageMountedToUrl'. Some special IRequestMappers (probably only PageInstanceMapper) should set 'false'.

By holding this argument into a field, we can determine to check equality of PageParameters or not.

It just an idea. not implemented yet. How do you think about this idea? If you give +1 to this idea, I will try to implement the idea.
                
> PageProvider should create a new Page instance if PageParameters are changed, even if a stored page exists.
> -----------------------------------------------------------------------------------------------------------
>
>                 Key: WICKET-4441
>                 URL: https://issues.apache.org/jira/browse/WICKET-4441
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>    Affects Versions: 1.5.5
>         Environment: all platform.
>            Reporter: Tsutomu YANO
>            Assignee: Martin Grigorov
>             Fix For: 1.5.6, 6.0.0-RC1
>
>         Attachments: WICKET-4441.patch, fix-WICKET-4441.patch, pagebug.tar.gz, pagebug2.tar.gz
>
>
> The 'getStoredPage(int)' method returns a stored page instance even if user changes parameter values encoded into URL, and the PageParameters object of the stored page instance is never changed. So same page is displayed always though user changes url on browser manually.
> ** HOW TO REPRODUCT **
> 1. unpack the attached sample project 'pagebug.tar.gz'.
> 2. mvn jetty:run
> 3. access to http://localhost:8080/user/user1
> You will see a form filled with information about user 1. The user's name is 'user 1', age is 30 and country is 'Japan'.
> The mount path of this page is '/user/${userId}'. so 'user1' in the accessed url is a parameter value.
> after accessing to the url, the url will be changed to http://localhost:8080/user/user1?0 .  it contains the page id of the currently displayed page.
> 4. change some values and submit the form. page id will be changed on every submit.
> 5. change only parameter value in url to 'user2'. Never change page-id.
> for example, if you now access to http://localhost:8080/user/user1?5, change the url to http://localhost:8080/user/user2?5 .
> 6. This program must display information about user2, because the parameter value of url is changed. But you will see the information of user 1. Wicket always display the page of page-id = 5 (even though user changed url manually).
> In this sample program, I use LoadableDetachableModel for retrieving current parameter-value. But I don't get the new parameter-value because pageParameters object in a page instance is never changed after the construction. pageParameters is fixed in the constructor of Page class.
> I think that there are no easy way to retrieve parameter-values encoded into mount-path. Request.getRequestParameters() does not contain parameters encoded into mount-path. So there are no work-around for this issue.
> ** HOW TO FIX THIS ISSUE **
> We must return null from getStoredPage(int) method of PageProvider class, if current PageParameters is not same with the PageParameters of a stored page. In current code, getStoredPage(int) checks only if the class of both pages are same. We must check the PageParameters of both pages.
> ** PATCH **
> I attached a pache for PageProvider class. try it.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (WICKET-4441) PageProvider should create a new Page instance if PageParameters are changed, even if a stored page exists.

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

Sven Meier commented on WICKET-4441:
------------------------------------

If PageProvider doesn't know any parameters, it doesn't care actually, does it?

PageProvider#isPageParametersSame():

	if (pageParameters == null)
	{
		return true;
	}


                
> PageProvider should create a new Page instance if PageParameters are changed, even if a stored page exists.
> -----------------------------------------------------------------------------------------------------------
>
>                 Key: WICKET-4441
>                 URL: https://issues.apache.org/jira/browse/WICKET-4441
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>    Affects Versions: 1.5.5
>         Environment: all platform.
>            Reporter: Tsutomu YANO
>            Assignee: Martin Grigorov
>         Attachments: WICKET-4441.patch, fix-WICKET-4441.patch, pagebug.tar.gz, pagebug2.tar.gz
>
>
> The 'getStoredPage(int)' method returns a stored page instance even if user changes parameter values encoded into URL, and the PageParameters object of the stored page instance is never changed. So same page is displayed always though user changes url on browser manually.
> ** HOW TO REPRODUCT **
> 1. unpack the attached sample project 'pagebug.tar.gz'.
> 2. mvn jetty:run
> 3. access to http://localhost:8080/user/user1
> You will see a form filled with information about user 1. The user's name is 'user 1', age is 30 and country is 'Japan'.
> The mount path of this page is '/user/${userId}'. so 'user1' in the accessed url is a parameter value.
> after accessing to the url, the url will be changed to http://localhost:8080/user/user1?0 .  it contains the page id of the currently displayed page.
> 4. change some values and submit the form. page id will be changed on every submit.
> 5. change only parameter value in url to 'user2'. Never change page-id.
> for example, if you now access to http://localhost:8080/user/user1?5, change the url to http://localhost:8080/user/user2?5 .
> 6. This program must display information about user2, because the parameter value of url is changed. But you will see the information of user 1. Wicket always display the page of page-id = 5 (even though user changed url manually).
> In this sample program, I use LoadableDetachableModel for retrieving current parameter-value. But I don't get the new parameter-value because pageParameters object in a page instance is never changed after the construction. pageParameters is fixed in the constructor of Page class.
> I think that there are no easy way to retrieve parameter-values encoded into mount-path. Request.getRequestParameters() does not contain parameters encoded into mount-path. So there are no work-around for this issue.
> ** HOW TO FIX THIS ISSUE **
> We must return null from getStoredPage(int) method of PageProvider class, if current PageParameters is not same with the PageParameters of a stored page. In current code, getStoredPage(int) checks only if the class of both pages are same. We must check the PageParameters of both pages.
> ** PATCH **
> I attached a pache for PageProvider class. try it.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Reopened] (WICKET-4441) PageProvider should create a new Page instance if PageParameters are changed, even if a stored page exists.

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

Martin Grigorov reopened WICKET-4441:
-------------------------------------


This change should be reverted. I breaks Ajax links as I found earlier. Even the assumption that empty parameters are OK is not valid.
Autocompleter, AjaxEditableLabel, ... are broken due to this.
                
> PageProvider should create a new Page instance if PageParameters are changed, even if a stored page exists.
> -----------------------------------------------------------------------------------------------------------
>
>                 Key: WICKET-4441
>                 URL: https://issues.apache.org/jira/browse/WICKET-4441
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>    Affects Versions: 1.5.5
>         Environment: all platform.
>            Reporter: Tsutomu YANO
>            Assignee: Martin Grigorov
>             Fix For: 1.5.6, 6.0.0-RC1
>
>         Attachments: WICKET-4441.patch, fix-WICKET-4441.patch, pagebug.tar.gz, pagebug2.tar.gz
>
>
> The 'getStoredPage(int)' method returns a stored page instance even if user changes parameter values encoded into URL, and the PageParameters object of the stored page instance is never changed. So same page is displayed always though user changes url on browser manually.
> ** HOW TO REPRODUCT **
> 1. unpack the attached sample project 'pagebug.tar.gz'.
> 2. mvn jetty:run
> 3. access to http://localhost:8080/user/user1
> You will see a form filled with information about user 1. The user's name is 'user 1', age is 30 and country is 'Japan'.
> The mount path of this page is '/user/${userId}'. so 'user1' in the accessed url is a parameter value.
> after accessing to the url, the url will be changed to http://localhost:8080/user/user1?0 .  it contains the page id of the currently displayed page.
> 4. change some values and submit the form. page id will be changed on every submit.
> 5. change only parameter value in url to 'user2'. Never change page-id.
> for example, if you now access to http://localhost:8080/user/user1?5, change the url to http://localhost:8080/user/user2?5 .
> 6. This program must display information about user2, because the parameter value of url is changed. But you will see the information of user 1. Wicket always display the page of page-id = 5 (even though user changed url manually).
> In this sample program, I use LoadableDetachableModel for retrieving current parameter-value. But I don't get the new parameter-value because pageParameters object in a page instance is never changed after the construction. pageParameters is fixed in the constructor of Page class.
> I think that there are no easy way to retrieve parameter-values encoded into mount-path. Request.getRequestParameters() does not contain parameters encoded into mount-path. So there are no work-around for this issue.
> ** HOW TO FIX THIS ISSUE **
> We must return null from getStoredPage(int) method of PageProvider class, if current PageParameters is not same with the PageParameters of a stored page. In current code, getStoredPage(int) checks only if the class of both pages are same. We must check the PageParameters of both pages.
> ** PATCH **
> I attached a pache for PageProvider class. try it.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (WICKET-4441) PageProvider should create a new Page instance if PageParameters are changed, even if a stored page exists.

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

Johannes Unterstein commented on WICKET-4441:
---------------------------------------------

Hi there,

we have the same issue.

We have a Page which accepts search requests via QueryParameters, like ".../OurPage?15&search=Hello+there" which delivers the page with the result for the search "Hello there". If the user manually changes the URL (and our users do not know about wicket pageIds and the meaning of the ?15) to ".../OurPage?15&search=Hello+world" the result for the search "Hello there" is still displayed and the search is NOT updated to "Hello world".

I implemented a MountedMapper which compares the PageParameters from the cached page and the PageParameters from the request and redirects the user to a fresh bookmarkable page, if the parameters do not match.

See: https://github.com/unterstein/wicket-tales/blob/master/src/main/java/org/wickettales/request/mapper/PageParameterAwareMountedMapper.java

My Problem is that the mountPage method of the application uses by default the original MountedMapper and we have no utility method to configurate the default Mapper for this method.
Whats about configuring the MountedMapper to use either the current behavior or my implemented alternative?

Cheers,
Johannes

                
> PageProvider should create a new Page instance if PageParameters are changed, even if a stored page exists.
> -----------------------------------------------------------------------------------------------------------
>
>                 Key: WICKET-4441
>                 URL: https://issues.apache.org/jira/browse/WICKET-4441
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>    Affects Versions: 1.5.5
>         Environment: all platform.
>            Reporter: Tsutomu YANO
>            Assignee: Martin Grigorov
>         Attachments: WICKET-4441.patch, fix-WICKET-4441.patch, pagebug.tar.gz, pagebug2.tar.gz
>
>
> The 'getStoredPage(int)' method returns a stored page instance even if user changes parameter values encoded into URL, and the PageParameters object of the stored page instance is never changed. So same page is displayed always though user changes url on browser manually.
> ** HOW TO REPRODUCT **
> 1. unpack the attached sample project 'pagebug.tar.gz'.
> 2. mvn jetty:run
> 3. access to http://localhost:8080/user/user1
> You will see a form filled with information about user 1. The user's name is 'user 1', age is 30 and country is 'Japan'.
> The mount path of this page is '/user/${userId}'. so 'user1' in the accessed url is a parameter value.
> after accessing to the url, the url will be changed to http://localhost:8080/user/user1?0 .  it contains the page id of the currently displayed page.
> 4. change some values and submit the form. page id will be changed on every submit.
> 5. change only parameter value in url to 'user2'. Never change page-id.
> for example, if you now access to http://localhost:8080/user/user1?5, change the url to http://localhost:8080/user/user2?5 .
> 6. This program must display information about user2, because the parameter value of url is changed. But you will see the information of user 1. Wicket always display the page of page-id = 5 (even though user changed url manually).
> In this sample program, I use LoadableDetachableModel for retrieving current parameter-value. But I don't get the new parameter-value because pageParameters object in a page instance is never changed after the construction. pageParameters is fixed in the constructor of Page class.
> I think that there are no easy way to retrieve parameter-values encoded into mount-path. Request.getRequestParameters() does not contain parameters encoded into mount-path. So there are no work-around for this issue.
> ** HOW TO FIX THIS ISSUE **
> We must return null from getStoredPage(int) method of PageProvider class, if current PageParameters is not same with the PageParameters of a stored page. In current code, getStoredPage(int) checks only if the class of both pages are same. We must check the PageParameters of both pages.
> ** PATCH **
> I attached a pache for PageProvider class. try it.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (WICKET-4441) PageProvider should create a new Page instance if PageParameters are changed, even if a stored page exists.

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

Martin Grigorov commented on WICKET-4441:
-----------------------------------------

The suggestion will be implemented because it solves a problem with bookmarkability: http://markmail.org/thread/q3ewso5dnf2wjsol
                
> PageProvider should create a new Page instance if PageParameters are changed, even if a stored page exists.
> -----------------------------------------------------------------------------------------------------------
>
>                 Key: WICKET-4441
>                 URL: https://issues.apache.org/jira/browse/WICKET-4441
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>    Affects Versions: 1.5.5
>         Environment: all platform.
>            Reporter: Tsutomu YANO
>            Assignee: Martin Grigorov
>         Attachments: fix-WICKET-4441.patch, pagebug.tar.gz, pagebug2.tar.gz
>
>
> The 'getStoredPage(int)' method returns a stored page instance even if user changes parameter values encoded into URL, and the PageParameters object of the stored page instance is never changed. So same page is displayed always though user changes url on browser manually.
> ** HOW TO REPRODUCT **
> 1. unpack the attached sample project 'pagebug.tar.gz'.
> 2. mvn jetty:run
> 3. access to http://localhost:8080/user/user1
> You will see a form filled with information about user 1. The user's name is 'user 1', age is 30 and country is 'Japan'.
> The mount path of this page is '/user/${userId}'. so 'user1' in the accessed url is a parameter value.
> after accessing to the url, the url will be changed to http://localhost:8080/user/user1?0 .  it contains the page id of the currently displayed page.
> 4. change some values and submit the form. page id will be changed on every submit.
> 5. change only parameter value in url to 'user2'. Never change page-id.
> for example, if you now access to http://localhost:8080/user/user1?5, change the url to http://localhost:8080/user/user2?5 .
> 6. This program must display information about user2, because the parameter value of url is changed. But you will see the information of user 1. Wicket always display the page of page-id = 5 (even though user changed url manually).
> In this sample program, I use LoadableDetachableModel for retrieving current parameter-value. But I don't get the new parameter-value because pageParameters object in a page instance is never changed after the construction. pageParameters is fixed in the constructor of Page class.
> I think that there are no easy way to retrieve parameter-values encoded into mount-path. Request.getRequestParameters() does not contain parameters encoded into mount-path. So there are no work-around for this issue.
> ** HOW TO FIX THIS ISSUE **
> We must return null from getStoredPage(int) method of PageProvider class, if current PageParameters is not same with the PageParameters of a stored page. In current code, getStoredPage(int) checks only if the class of both pages are same. We must check the PageParameters of both pages.
> ** PATCH **
> I attached a pache for PageProvider class. try it.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Issue Comment Edited] (WICKET-4441) PageProvider should create a new Page instance if PageParameters are changed, even if a stored page exists.

Posted by "Tsutomu YANO (Issue Comment Edited) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WICKET-4441?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13224401#comment-13224401 ] 

Tsutomu YANO edited comment on WICKET-4441 at 3/7/12 3:24 PM:
--------------------------------------------------------------

I know that the PageParameters object is that contains the GET parameters which ware available when the page was created, because it is described in Javadoc. Truly, THAT was a reason I post this issue as a BUG.

Before I post this issue, same as you wrote in previous post, I thought that I could get the new parameter-value from getRequest().getRequestParameters(). But I couldn't, because getRequest().getRequestParameters() doesn't contain the parameters which encoded into mount-path like '/mount-path/${parameter-name}', but it contains only current query-parameters and post-parameters. Because the encoded parameters are not query-parameters nor post-parameters.  Simplly a part of url.

I attach a new sample project where I log all parameter-keys and values of getRequest().getRequestParameter() in onBeforeRender().  That doesn't contain the parameters encoded into mount-path.

(Note: a attached project references wicket 1.5.4 statically for testing. But same with wicket-1.5-SNAPSHOT.)


Our problem is that we have no way to easily get parameter-values from mount-path. We can get parameter-values of query-parameters and post-parameters, because wicket provide the way through getRequestParameters(), getQueryParameters() or getPostParameters(). But there is no way to get the parameters encoded into url.

The only way to retrieve the values from url is that we do same thing which MountedMapper do. Is it the right way to do that in wicket? I can not believe it. 

summary:

1. PageParameters is the object which contains the parameters which the page is created (it is decribed in JavaDoc, so we can not change the behavior easily).

2. getRequest().getRequestParameters() contains only query-parameters and post-parameters, but doesn't contain parameters which encoded into url by mount-path (the function for encoding parameters into URL is introduced from wicket 1.5, so older versions don't have this issue, I think.).

3. There is no easy way to retrieve parameter-values from URL (I think the only way is doing same thing MountedMapper do).

4. So the only easily implementable and ligically acceptable way to provide ALL CURRENT parameters (including parameters encoded into url) for users is that we reconstruct a new page if a part of parameters is changed. Users can get all current parameters from PageParameters.

If URL is changed, the page object is newly created. Parameters encoded into URL are a part of URL, so it is acceptable for me.

If there are another easy ways already, this ticket is my mistake, but I could not find them. I think, if creating a new page instance for each parameter-change is not acceptable for you, (I hope) you should provide another way to retrieve ALL CURRENT PARAMETER VALUES easily for our users of Wicket. We can retrieve query-parameters and post-parameters easily, but not parameters encoded into url.


                
      was (Author: t_yano):
    I know that the PageParameters object is that contains the GET parameters which ware available when the page was created, because it is described in Javadoc. Truly, THAT was a reason I post this issue as a BUG.

Before I post this issue, same as you wrote in previous post, I thought that I could get the new parameter-value from getRequest().getRequestParameters(). But I couldn't, because getRequest().getRequestParameters() doesn't contain the parameters which encoded into mount-path like '/mount-path/${parameter-name}', but it contains only current query-parameters and post-parameters. Because the encoded parameters are not query-parameters nor post-parameters.  Simplly a part of url.

I attach a new sample project where I log all parameter-keys and values of getRequest().getRequestParameter() in onBeforeRender().  That doesn't contain the parameters encoded into mount-path.

(Note: a attached project references wicket 1.5.4 statically for testing. But same with wicket-1.5-SNAPSHOT.)


Our problem is that we have no way to easily get parameter-values from mount-path. We can get parameter-values of query-parameters and post-parameters, because wicket provide the way through getRequestParameters(), getQueryParameters() or getPostParameters(). But there is no way to get the parameters encoded into url.

The only way to retrieve the values from url is that we do same thing which MountedMapper do. Is it the right way to do that in wicket? I can not believe it. 

summary:

1. PageParameters is the object which contains the parameters which the page is created (it is decribed in JavaDoc, so we can not change the behavior easily).

2. getRequest().getRequestParameters() contains only query-parameters and post-parameters, but doesn't contain parameters which encoded into url by mount-path (the function for encoding parameters into URL is introduced from wicket 1.5, so older versions don't have this issue, I think.).

3. There is no easy way to retrieve parameter-values from URL (I think the only way is doing same thing MountedMapper do).

4. So the only easily implementable and ligically acceptable way to provide ALL CURRENT parameters (including parameters encoded into url) for users is that we reconstruct a new page if a part of parameters is changed. Users can all current parameters from PageParameters.

If URL is changed, the page object is newly created. Parameters encoded into URL are a part of URL, so it is acceptable for me.

If there are another easy ways already, this ticket is my mistake, but I could not find them. I think, if creating a new page instance for each parameter-change is not acceptable for you, (I hope) you should provide another way to retrieve ALL CURRENT PARAMETER VALUES easily for our users of Wicket. We can retrieve query-parameters and post-parameters easily, but not parameters encoded into url.


                  
> PageProvider should create a new Page instance if PageParameters are changed, even if a stored page exists.
> -----------------------------------------------------------------------------------------------------------
>
>                 Key: WICKET-4441
>                 URL: https://issues.apache.org/jira/browse/WICKET-4441
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>    Affects Versions: 1.5.5
>         Environment: all platform.
>            Reporter: Tsutomu YANO
>         Attachments: fix-WICKET-4441.patch, pagebug.tar.gz, pagebug2.tar.gz
>
>
> The 'getStoredPage(int)' method returns a stored page instance even if user changes parameter values encoded into URL, and the PageParameters object of the stored page instance is never changed. So same page is displayed always though user changes url on browser manually.
> ** HOW TO REPRODUCT **
> 1. unpack the attached sample project 'pagebug.tar.gz'.
> 2. mvn jetty:run
> 3. access to http://localhost:8080/user/user1
> You will see a form filled with information about user 1. The user's name is 'user 1', age is 30 and country is 'Japan'.
> The mount path of this page is '/user/${userId}'. so 'user1' in the accessed url is a parameter value.
> after accessing to the url, the url will be changed to http://localhost:8080/user/user1?0 .  it contains the page id of the currently displayed page.
> 4. change some values and submit the form. page id will be changed on every submit.
> 5. change only parameter value in url to 'user2'. Never change page-id.
> for example, if you now access to http://localhost:8080/user/user1?5, change the url to http://localhost:8080/user/user2?5 .
> 6. This program must display information about user2, because the parameter value of url is changed. But you will see the information of user 1. Wicket always display the page of page-id = 5 (even though user changed url manually).
> In this sample program, I use LoadableDetachableModel for retrieving current parameter-value. But I don't get the new parameter-value because pageParameters object in a page instance is never changed after the construction. pageParameters is fixed in the constructor of Page class.
> I think that there are no easy way to retrieve parameter-values encoded into mount-path. Request.getRequestParameters() does not contain parameters encoded into mount-path. So there are no work-around for this issue.
> ** HOW TO FIX THIS ISSUE **
> We must return null from getStoredPage(int) method of PageProvider class, if current PageParameters is not same with the PageParameters of a stored page. In current code, getStoredPage(int) checks only if the class of both pages are same. We must check the PageParameters of both pages.
> ** PATCH **
> I attached a pache for PageProvider class. try it.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (WICKET-4441) PageProvider should create a new Page instance if PageParameters are changed, even if a stored page exists.

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

Tsutomu YANO updated WICKET-4441:
---------------------------------

    Attachment: pagebug2.tar.gz

A new sample project for reproduce this issue.
                
> PageProvider should create a new Page instance if PageParameters are changed, even if a stored page exists.
> -----------------------------------------------------------------------------------------------------------
>
>                 Key: WICKET-4441
>                 URL: https://issues.apache.org/jira/browse/WICKET-4441
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>    Affects Versions: 1.5.5
>         Environment: all platform.
>            Reporter: Tsutomu YANO
>         Attachments: fix-WICKET-4441.patch, pagebug.tar.gz, pagebug2.tar.gz
>
>
> The 'getStoredPage(int)' method returns a stored page instance even if user changes parameter values encoded into URL, and the PageParameters object of the stored page instance is never changed. So same page is displayed always though user changes url on browser manually.
> ** HOW TO REPRODUCT **
> 1. unpack the attached sample project 'pagebug.tar.gz'.
> 2. mvn jetty:run
> 3. access to http://localhost:8080/user/user1
> You will see a form filled with information about user 1. The user's name is 'user 1', age is 30 and country is 'Japan'.
> The mount path of this page is '/user/${userId}'. so 'user1' in the accessed url is a parameter value.
> after accessing to the url, the url will be changed to http://localhost:8080/user/user1?0 .  it contains the page id of the currently displayed page.
> 4. change some values and submit the form. page id will be changed on every submit.
> 5. change only parameter value in url to 'user2'. Never change page-id.
> for example, if you now access to http://localhost:8080/user/user1?5, change the url to http://localhost:8080/user/user2?5 .
> 6. This program must display information about user2, because the parameter value of url is changed. But you will see the information of user 1. Wicket always display the page of page-id = 5 (even though user changed url manually).
> In this sample program, I use LoadableDetachableModel for retrieving current parameter-value. But I don't get the new parameter-value because pageParameters object in a page instance is never changed after the construction. pageParameters is fixed in the constructor of Page class.
> I think that there are no easy way to retrieve parameter-values encoded into mount-path. Request.getRequestParameters() does not contain parameters encoded into mount-path. So there are no work-around for this issue.
> ** HOW TO FIX THIS ISSUE **
> We must return null from getStoredPage(int) method of PageProvider class, if current PageParameters is not same with the PageParameters of a stored page. In current code, getStoredPage(int) checks only if the class of both pages are same. We must check the PageParameters of both pages.
> ** PATCH **
> I attached a pache for PageProvider class. try it.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (WICKET-4441) PageProvider should create a new Page instance if PageParameters are changed, even if a stored page exists.

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

Martin Grigorov updated WICKET-4441:
------------------------------------

    Fix Version/s:     (was: 6.0.0-RC1)
                       (was: 1.5.6)
    
> PageProvider should create a new Page instance if PageParameters are changed, even if a stored page exists.
> -----------------------------------------------------------------------------------------------------------
>
>                 Key: WICKET-4441
>                 URL: https://issues.apache.org/jira/browse/WICKET-4441
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>    Affects Versions: 1.5.5
>         Environment: all platform.
>            Reporter: Tsutomu YANO
>            Assignee: Martin Grigorov
>         Attachments: WICKET-4441.patch, fix-WICKET-4441.patch, pagebug.tar.gz, pagebug2.tar.gz
>
>
> The 'getStoredPage(int)' method returns a stored page instance even if user changes parameter values encoded into URL, and the PageParameters object of the stored page instance is never changed. So same page is displayed always though user changes url on browser manually.
> ** HOW TO REPRODUCT **
> 1. unpack the attached sample project 'pagebug.tar.gz'.
> 2. mvn jetty:run
> 3. access to http://localhost:8080/user/user1
> You will see a form filled with information about user 1. The user's name is 'user 1', age is 30 and country is 'Japan'.
> The mount path of this page is '/user/${userId}'. so 'user1' in the accessed url is a parameter value.
> after accessing to the url, the url will be changed to http://localhost:8080/user/user1?0 .  it contains the page id of the currently displayed page.
> 4. change some values and submit the form. page id will be changed on every submit.
> 5. change only parameter value in url to 'user2'. Never change page-id.
> for example, if you now access to http://localhost:8080/user/user1?5, change the url to http://localhost:8080/user/user2?5 .
> 6. This program must display information about user2, because the parameter value of url is changed. But you will see the information of user 1. Wicket always display the page of page-id = 5 (even though user changed url manually).
> In this sample program, I use LoadableDetachableModel for retrieving current parameter-value. But I don't get the new parameter-value because pageParameters object in a page instance is never changed after the construction. pageParameters is fixed in the constructor of Page class.
> I think that there are no easy way to retrieve parameter-values encoded into mount-path. Request.getRequestParameters() does not contain parameters encoded into mount-path. So there are no work-around for this issue.
> ** HOW TO FIX THIS ISSUE **
> We must return null from getStoredPage(int) method of PageProvider class, if current PageParameters is not same with the PageParameters of a stored page. In current code, getStoredPage(int) checks only if the class of both pages are same. We must check the PageParameters of both pages.
> ** PATCH **
> I attached a pache for PageProvider class. try it.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Issue Comment Edited] (WICKET-4441) PageProvider should create a new Page instance if PageParameters are changed, even if a stored page exists.

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

Martin Grigorov edited comment on WICKET-4441 at 4/26/12 8:18 AM:
------------------------------------------------------------------

This change should be reverted. it breaks Ajax links as I found earlier. Even the assumption that empty parameters are OK is not valid.
Autocompleter, AjaxEditableLabel, ... are broken due to this.
                
      was (Author: mgrigorov):
    This change should be reverted. I breaks Ajax links as I found earlier. Even the assumption that empty parameters are OK is not valid.
Autocompleter, AjaxEditableLabel, ... are broken due to this.
                  
> PageProvider should create a new Page instance if PageParameters are changed, even if a stored page exists.
> -----------------------------------------------------------------------------------------------------------
>
>                 Key: WICKET-4441
>                 URL: https://issues.apache.org/jira/browse/WICKET-4441
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>    Affects Versions: 1.5.5
>         Environment: all platform.
>            Reporter: Tsutomu YANO
>            Assignee: Martin Grigorov
>             Fix For: 1.5.6, 6.0.0-RC1
>
>         Attachments: WICKET-4441.patch, fix-WICKET-4441.patch, pagebug.tar.gz, pagebug2.tar.gz
>
>
> The 'getStoredPage(int)' method returns a stored page instance even if user changes parameter values encoded into URL, and the PageParameters object of the stored page instance is never changed. So same page is displayed always though user changes url on browser manually.
> ** HOW TO REPRODUCT **
> 1. unpack the attached sample project 'pagebug.tar.gz'.
> 2. mvn jetty:run
> 3. access to http://localhost:8080/user/user1
> You will see a form filled with information about user 1. The user's name is 'user 1', age is 30 and country is 'Japan'.
> The mount path of this page is '/user/${userId}'. so 'user1' in the accessed url is a parameter value.
> after accessing to the url, the url will be changed to http://localhost:8080/user/user1?0 .  it contains the page id of the currently displayed page.
> 4. change some values and submit the form. page id will be changed on every submit.
> 5. change only parameter value in url to 'user2'. Never change page-id.
> for example, if you now access to http://localhost:8080/user/user1?5, change the url to http://localhost:8080/user/user2?5 .
> 6. This program must display information about user2, because the parameter value of url is changed. But you will see the information of user 1. Wicket always display the page of page-id = 5 (even though user changed url manually).
> In this sample program, I use LoadableDetachableModel for retrieving current parameter-value. But I don't get the new parameter-value because pageParameters object in a page instance is never changed after the construction. pageParameters is fixed in the constructor of Page class.
> I think that there are no easy way to retrieve parameter-values encoded into mount-path. Request.getRequestParameters() does not contain parameters encoded into mount-path. So there are no work-around for this issue.
> ** HOW TO FIX THIS ISSUE **
> We must return null from getStoredPage(int) method of PageProvider class, if current PageParameters is not same with the PageParameters of a stored page. In current code, getStoredPage(int) checks only if the class of both pages are same. We must check the PageParameters of both pages.
> ** PATCH **
> I attached a pache for PageProvider class. try it.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Resolved] (WICKET-4441) PageProvider should create a new Page instance if PageParameters are changed, even if a stored page exists.

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

Martin Grigorov resolved WICKET-4441.
-------------------------------------

       Resolution: Fixed
    Fix Version/s: 6.0.0-RC1
                   1.5.6

If current's request page parameters are empty then we don't make the check for equality with the parameters of the stored page (as Sven suggested in the previous comment).
                
> PageProvider should create a new Page instance if PageParameters are changed, even if a stored page exists.
> -----------------------------------------------------------------------------------------------------------
>
>                 Key: WICKET-4441
>                 URL: https://issues.apache.org/jira/browse/WICKET-4441
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>    Affects Versions: 1.5.5
>         Environment: all platform.
>            Reporter: Tsutomu YANO
>            Assignee: Martin Grigorov
>             Fix For: 1.5.6, 6.0.0-RC1
>
>         Attachments: WICKET-4441.patch, fix-WICKET-4441.patch, pagebug.tar.gz, pagebug2.tar.gz
>
>
> The 'getStoredPage(int)' method returns a stored page instance even if user changes parameter values encoded into URL, and the PageParameters object of the stored page instance is never changed. So same page is displayed always though user changes url on browser manually.
> ** HOW TO REPRODUCT **
> 1. unpack the attached sample project 'pagebug.tar.gz'.
> 2. mvn jetty:run
> 3. access to http://localhost:8080/user/user1
> You will see a form filled with information about user 1. The user's name is 'user 1', age is 30 and country is 'Japan'.
> The mount path of this page is '/user/${userId}'. so 'user1' in the accessed url is a parameter value.
> after accessing to the url, the url will be changed to http://localhost:8080/user/user1?0 .  it contains the page id of the currently displayed page.
> 4. change some values and submit the form. page id will be changed on every submit.
> 5. change only parameter value in url to 'user2'. Never change page-id.
> for example, if you now access to http://localhost:8080/user/user1?5, change the url to http://localhost:8080/user/user2?5 .
> 6. This program must display information about user2, because the parameter value of url is changed. But you will see the information of user 1. Wicket always display the page of page-id = 5 (even though user changed url manually).
> In this sample program, I use LoadableDetachableModel for retrieving current parameter-value. But I don't get the new parameter-value because pageParameters object in a page instance is never changed after the construction. pageParameters is fixed in the constructor of Page class.
> I think that there are no easy way to retrieve parameter-values encoded into mount-path. Request.getRequestParameters() does not contain parameters encoded into mount-path. So there are no work-around for this issue.
> ** HOW TO FIX THIS ISSUE **
> We must return null from getStoredPage(int) method of PageProvider class, if current PageParameters is not same with the PageParameters of a stored page. In current code, getStoredPage(int) checks only if the class of both pages are same. We must check the PageParameters of both pages.
> ** PATCH **
> I attached a pache for PageProvider class. try it.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (WICKET-4441) PageProvider should create a new Page instance if PageParameters are changed, even if a stored page exists.

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

Martin Grigorov updated WICKET-4441:
------------------------------------

    Attachment: WICKET-4441.patch

Here is a patch that almost solves the problem but unfortunately it causes a bigger one.

See test org.apache.wicket.markup.html.link.MountedPageLinkTest#testLinkOnPageWithRecreationDisabled. It demonstrates that this fix causes an even bigger problem: the user cannot click any link in the page because link's url looks like "./wicket/page?0-1.ILinkListener-link" and it doesn't have the initial page parameters. So Wicket finds the page with pageId=0 in the store, but the check for page parameters fail and PageExpiredException is being thrown.

The changes in mapper tests are needed just because their test infrastructure (TestMapperContext) does some cheats.
                
> PageProvider should create a new Page instance if PageParameters are changed, even if a stored page exists.
> -----------------------------------------------------------------------------------------------------------
>
>                 Key: WICKET-4441
>                 URL: https://issues.apache.org/jira/browse/WICKET-4441
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>    Affects Versions: 1.5.5
>         Environment: all platform.
>            Reporter: Tsutomu YANO
>            Assignee: Martin Grigorov
>         Attachments: WICKET-4441.patch, fix-WICKET-4441.patch, pagebug.tar.gz, pagebug2.tar.gz
>
>
> The 'getStoredPage(int)' method returns a stored page instance even if user changes parameter values encoded into URL, and the PageParameters object of the stored page instance is never changed. So same page is displayed always though user changes url on browser manually.
> ** HOW TO REPRODUCT **
> 1. unpack the attached sample project 'pagebug.tar.gz'.
> 2. mvn jetty:run
> 3. access to http://localhost:8080/user/user1
> You will see a form filled with information about user 1. The user's name is 'user 1', age is 30 and country is 'Japan'.
> The mount path of this page is '/user/${userId}'. so 'user1' in the accessed url is a parameter value.
> after accessing to the url, the url will be changed to http://localhost:8080/user/user1?0 .  it contains the page id of the currently displayed page.
> 4. change some values and submit the form. page id will be changed on every submit.
> 5. change only parameter value in url to 'user2'. Never change page-id.
> for example, if you now access to http://localhost:8080/user/user1?5, change the url to http://localhost:8080/user/user2?5 .
> 6. This program must display information about user2, because the parameter value of url is changed. But you will see the information of user 1. Wicket always display the page of page-id = 5 (even though user changed url manually).
> In this sample program, I use LoadableDetachableModel for retrieving current parameter-value. But I don't get the new parameter-value because pageParameters object in a page instance is never changed after the construction. pageParameters is fixed in the constructor of Page class.
> I think that there are no easy way to retrieve parameter-values encoded into mount-path. Request.getRequestParameters() does not contain parameters encoded into mount-path. So there are no work-around for this issue.
> ** HOW TO FIX THIS ISSUE **
> We must return null from getStoredPage(int) method of PageProvider class, if current PageParameters is not same with the PageParameters of a stored page. In current code, getStoredPage(int) checks only if the class of both pages are same. We must check the PageParameters of both pages.
> ** PATCH **
> I attached a pache for PageProvider class. try it.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (WICKET-4441) PageProvider should create a new Page instance if PageParameters are changed, even if a stored page exists.

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

Tsutomu YANO updated WICKET-4441:
---------------------------------

    Description: 
The 'getStoredPage(int)' method returns a stored page instance even if user changes parameter values encoded into URL, and the PageParameters object of the stored page instance is never changed. So same page is displayed always though user changes url on browser manually.

** HOW TO REPRODUCT **

1. unpack the attached sample project 'pagebug.zip'.
2. mvn jetty:run
3. access to http://localhost:8080/user/user1

You will see a form filled with information about user 1. The user's name is 'user 1', age is 30 and country is 'Japan'.
The mount path of this page is '/user/${userId}'. so 'user1' in the accessed url is a parameter value.

after accessing to the url, the url will be changed to 'http://localhost:8080/user/user1?0'.  it contains the page id of the currently displayed page.

4. change some values and submit the form. page id will be changed on every submit.

5. change only parameter value in url to 'user2'. Never change page-id.

for example, if you now access to 'http://localhost:8080/user/user1?5', change the url to 'http://localhost:8080/user/user2?5' .

6. This program must display information about user2, because the parameter value of url is changed. But you will see the information of user 1. Wicket always display the page of page-id = 5 (even though user changed url manually).

In this sample program, I use LoadableDetachableModel for retrieving current parameter-value. But I don't get the new parameter-value because pageParameters object in a page instance is never changed after the construction. pageParameters is fixed in the constructor of Page class.

I think that there are no easy way to retrieve parameter-values encoded into mount-path. Request.getRequestParameters() does not contain parameters encoded into mount-path. So there are no work-around for this issue.


** HOW TO FIX THIS ISSUE **

We must return null from getStoredPage(int) method of PageProvider class, if current PageParameters is not same with the PageParameters of a stored page. In current code, getStoredPage(int) checks only if the class of both pages are same. We must check the PageParameters of both pages.


** PATCH **

I attached a pache for PageProvider class. try it.




  was:
The 'getStoredPage(int)' method returns a stored page instance even if user changes parameter values encoded into URL, and the PageParameters object of the stored page instance is never changed. So same page is displayed always though user changes url on browser manually.

** HOW TO REPRODUCT **

1. unpack the attached sample project 'pagebug.zip'.
2. mvn jetty:run
3. access to http://localhost:8080/user/user1

You will see a form filled with information about user 1. The user's name is 'user 1', age is 30 and country is 'Japan'.
The mount path of this page is '/user/${userId}'. so 'user1' in the accessed url is a parameter value.

after accessing to the url, the url will be changed to 'http://localhost:8080/user/user1?0'.  it contains the page id of the currently displayed page.

4. change some values and submit the form. page id will be changed on every submit.

5. change only parameter value in url to 'user2'. Never change page-id.

for example, if you now access to 'http://localhost:8080/user/user1?5', change the url to 'http://localhost:8080/user/user2?5' .

6. This program must display information about user2, because the parameter value of url is changed. But you will see the information of user 1. Wicket always display the page of page-id = 5 (even though user changed url manually).

In this sample program, I use LoadableDetachableModel for retrieving current parameter-value. But I don't get the new parameter-value because pageParameters object in a page instance is never changed after the construction. pageParameters is fixed in the constructor of Page class.

I think that there are no easy way to retrieve parameter-values encoded into mount-path. Request.getRequestParameters() does not contain parameters encoded into mount-path. So there are no work-around for this issue.


** HOW TO FIX THIS ISSUE **

We must return null from getStoredPage(int) method of PageProvider class, if current PageParameters is not same with the PageParameters of a stored page. In current code, getStoredPage(int) checks only if the class of both pages are same. We must check the PageParameters of both pages.


** PATCH **

I attached a pache which fix this issue. try it.




    
> PageProvider should create a new Page instance if PageParameters are changed, even if a stored page exists.
> -----------------------------------------------------------------------------------------------------------
>
>                 Key: WICKET-4441
>                 URL: https://issues.apache.org/jira/browse/WICKET-4441
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>    Affects Versions: 1.5.5
>         Environment: all platform.
>            Reporter: Tsutomu YANO
>
> The 'getStoredPage(int)' method returns a stored page instance even if user changes parameter values encoded into URL, and the PageParameters object of the stored page instance is never changed. So same page is displayed always though user changes url on browser manually.
> ** HOW TO REPRODUCT **
> 1. unpack the attached sample project 'pagebug.zip'.
> 2. mvn jetty:run
> 3. access to http://localhost:8080/user/user1
> You will see a form filled with information about user 1. The user's name is 'user 1', age is 30 and country is 'Japan'.
> The mount path of this page is '/user/${userId}'. so 'user1' in the accessed url is a parameter value.
> after accessing to the url, the url will be changed to 'http://localhost:8080/user/user1?0'.  it contains the page id of the currently displayed page.
> 4. change some values and submit the form. page id will be changed on every submit.
> 5. change only parameter value in url to 'user2'. Never change page-id.
> for example, if you now access to 'http://localhost:8080/user/user1?5', change the url to 'http://localhost:8080/user/user2?5' .
> 6. This program must display information about user2, because the parameter value of url is changed. But you will see the information of user 1. Wicket always display the page of page-id = 5 (even though user changed url manually).
> In this sample program, I use LoadableDetachableModel for retrieving current parameter-value. But I don't get the new parameter-value because pageParameters object in a page instance is never changed after the construction. pageParameters is fixed in the constructor of Page class.
> I think that there are no easy way to retrieve parameter-values encoded into mount-path. Request.getRequestParameters() does not contain parameters encoded into mount-path. So there are no work-around for this issue.
> ** HOW TO FIX THIS ISSUE **
> We must return null from getStoredPage(int) method of PageProvider class, if current PageParameters is not same with the PageParameters of a stored page. In current code, getStoredPage(int) checks only if the class of both pages are same. We must check the PageParameters of both pages.
> ** PATCH **
> I attached a pache for PageProvider class. try it.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (WICKET-4441) PageProvider should create a new Page instance if PageParameters are changed, even if a stored page exists.

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

Tsutomu YANO updated WICKET-4441:
---------------------------------

          Component/s: wicket
          Description: 
The 'getStoredPage(int)' method returns a stored page instance even if user changes parameter values encoded into URL, and the PageParameters object of the stored page instance is never changed. So same page is displayed always though user changes url on browser manually.

** HOW TO REPRODUCT **

1. unpack the attached sample project 'pagebug.zip'.
2. mvn jetty:run
3. access to http://localhost:8080/user/user1

You will see a form filled with information about user 1. The user's name is 'user 1', age is 30 and country is 'Japan'.
The mount path of this page is '/user/${userId}'. so 'user1' in the accessed url is a parameter value.

after accessing to the url, the url will be changed to 'http://localhost:8080/user/user1?0'.  it contains the page id of the currently displayed page.

4. change some values and submit the form. page id will be changed on every submit.

5. change only parameter value in url to 'user2'. Never change page-id.

for example, if you now access to 'http://localhost:8080/user/user1?5', change the url to 'http://localhost:8080/user/user2?5' .

6. This program must display information about user2, because the parameter value of url is changed. But you will see the information of user 1. Wicket always display the page of page-id = 5 (even though user changed url manually).

In this sample program, I use LoadableDetachableModel for retrieving current parameter-value. But I don't get the new parameter-value because pageParameters object in a page instance is never changed after the construction. pageParameters is fixed in the constructor of Page class.

I think that there are no easy way to retrieve parameter-values encoded into mount-path. Request.getRequestParameters() does not contain parameters encoded into mount-path. So there are no work-around for this issue.


** HOW TO FIX THIS ISSUE **

We must return null from getStoredPage(int) method of PageProvider class, if current PageParameters is not same with the PageParameters of a stored page. In current code, getStoredPage(int) checks only if the class of both pages are same. We must check the PageParameters of both pages.


** PATCH **

I attached a pache which fix this issue. try it.



          Environment: all platform.
    Affects Version/s: 1.5.5
              Summary: PageProvider should create a new Page instance if PageParameters are changed, even if a stored page exists.  (was: PageProvider should )
    
> PageProvider should create a new Page instance if PageParameters are changed, even if a stored page exists.
> -----------------------------------------------------------------------------------------------------------
>
>                 Key: WICKET-4441
>                 URL: https://issues.apache.org/jira/browse/WICKET-4441
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>    Affects Versions: 1.5.5
>         Environment: all platform.
>            Reporter: Tsutomu YANO
>
> The 'getStoredPage(int)' method returns a stored page instance even if user changes parameter values encoded into URL, and the PageParameters object of the stored page instance is never changed. So same page is displayed always though user changes url on browser manually.
> ** HOW TO REPRODUCT **
> 1. unpack the attached sample project 'pagebug.zip'.
> 2. mvn jetty:run
> 3. access to http://localhost:8080/user/user1
> You will see a form filled with information about user 1. The user's name is 'user 1', age is 30 and country is 'Japan'.
> The mount path of this page is '/user/${userId}'. so 'user1' in the accessed url is a parameter value.
> after accessing to the url, the url will be changed to 'http://localhost:8080/user/user1?0'.  it contains the page id of the currently displayed page.
> 4. change some values and submit the form. page id will be changed on every submit.
> 5. change only parameter value in url to 'user2'. Never change page-id.
> for example, if you now access to 'http://localhost:8080/user/user1?5', change the url to 'http://localhost:8080/user/user2?5' .
> 6. This program must display information about user2, because the parameter value of url is changed. But you will see the information of user 1. Wicket always display the page of page-id = 5 (even though user changed url manually).
> In this sample program, I use LoadableDetachableModel for retrieving current parameter-value. But I don't get the new parameter-value because pageParameters object in a page instance is never changed after the construction. pageParameters is fixed in the constructor of Page class.
> I think that there are no easy way to retrieve parameter-values encoded into mount-path. Request.getRequestParameters() does not contain parameters encoded into mount-path. So there are no work-around for this issue.
> ** HOW TO FIX THIS ISSUE **
> We must return null from getStoredPage(int) method of PageProvider class, if current PageParameters is not same with the PageParameters of a stored page. In current code, getStoredPage(int) checks only if the class of both pages are same. We must check the PageParameters of both pages.
> ** PATCH **
> I attached a pache which fix this issue. try it.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (WICKET-4441) PageProvider should create a new Page instance if PageParameters are changed, even if a stored page exists.

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

Tsutomu YANO updated WICKET-4441:
---------------------------------

    Attachment: pagebug.tar.gz
    
> PageProvider should create a new Page instance if PageParameters are changed, even if a stored page exists.
> -----------------------------------------------------------------------------------------------------------
>
>                 Key: WICKET-4441
>                 URL: https://issues.apache.org/jira/browse/WICKET-4441
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>    Affects Versions: 1.5.5
>         Environment: all platform.
>            Reporter: Tsutomu YANO
>         Attachments: fix-WICKET-4441.patch, pagebug.tar.gz
>
>
> The 'getStoredPage(int)' method returns a stored page instance even if user changes parameter values encoded into URL, and the PageParameters object of the stored page instance is never changed. So same page is displayed always though user changes url on browser manually.
> ** HOW TO REPRODUCT **
> 1. unpack the attached sample project 'pagebug.tar.gz'.
> 2. mvn jetty:run
> 3. access to http://localhost:8080/user/user1
> You will see a form filled with information about user 1. The user's name is 'user 1', age is 30 and country is 'Japan'.
> The mount path of this page is '/user/${userId}'. so 'user1' in the accessed url is a parameter value.
> after accessing to the url, the url will be changed to 'http://localhost:8080/user/user1?0'.  it contains the page id of the currently displayed page.
> 4. change some values and submit the form. page id will be changed on every submit.
> 5. change only parameter value in url to 'user2'. Never change page-id.
> for example, if you now access to 'http://localhost:8080/user/user1?5', change the url to 'http://localhost:8080/user/user2?5' .
> 6. This program must display information about user2, because the parameter value of url is changed. But you will see the information of user 1. Wicket always display the page of page-id = 5 (even though user changed url manually).
> In this sample program, I use LoadableDetachableModel for retrieving current parameter-value. But I don't get the new parameter-value because pageParameters object in a page instance is never changed after the construction. pageParameters is fixed in the constructor of Page class.
> I think that there are no easy way to retrieve parameter-values encoded into mount-path. Request.getRequestParameters() does not contain parameters encoded into mount-path. So there are no work-around for this issue.
> ** HOW TO FIX THIS ISSUE **
> We must return null from getStoredPage(int) method of PageProvider class, if current PageParameters is not same with the PageParameters of a stored page. In current code, getStoredPage(int) checks only if the class of both pages are same. We must check the PageParameters of both pages.
> ** PATCH **
> I attached a pache for PageProvider class. try it.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Reopened] (WICKET-4441) PageProvider should create a new Page instance if PageParameters are changed, even if a stored page exists.

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

Martin Grigorov reopened WICKET-4441:
-------------------------------------


I see what you mean...
But I'm still not convinced that your suggested approach is the right one. So I'll reopen the ticket so other Wicket devs can say what they think about it.

Until then I think you can use PageParametersEncoder to create PageParameters out of the current Request in #onBeforeRender() and use them.
                
> PageProvider should create a new Page instance if PageParameters are changed, even if a stored page exists.
> -----------------------------------------------------------------------------------------------------------
>
>                 Key: WICKET-4441
>                 URL: https://issues.apache.org/jira/browse/WICKET-4441
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>    Affects Versions: 1.5.5
>         Environment: all platform.
>            Reporter: Tsutomu YANO
>         Attachments: fix-WICKET-4441.patch, pagebug.tar.gz, pagebug2.tar.gz
>
>
> The 'getStoredPage(int)' method returns a stored page instance even if user changes parameter values encoded into URL, and the PageParameters object of the stored page instance is never changed. So same page is displayed always though user changes url on browser manually.
> ** HOW TO REPRODUCT **
> 1. unpack the attached sample project 'pagebug.tar.gz'.
> 2. mvn jetty:run
> 3. access to http://localhost:8080/user/user1
> You will see a form filled with information about user 1. The user's name is 'user 1', age is 30 and country is 'Japan'.
> The mount path of this page is '/user/${userId}'. so 'user1' in the accessed url is a parameter value.
> after accessing to the url, the url will be changed to http://localhost:8080/user/user1?0 .  it contains the page id of the currently displayed page.
> 4. change some values and submit the form. page id will be changed on every submit.
> 5. change only parameter value in url to 'user2'. Never change page-id.
> for example, if you now access to http://localhost:8080/user/user1?5, change the url to http://localhost:8080/user/user2?5 .
> 6. This program must display information about user2, because the parameter value of url is changed. But you will see the information of user 1. Wicket always display the page of page-id = 5 (even though user changed url manually).
> In this sample program, I use LoadableDetachableModel for retrieving current parameter-value. But I don't get the new parameter-value because pageParameters object in a page instance is never changed after the construction. pageParameters is fixed in the constructor of Page class.
> I think that there are no easy way to retrieve parameter-values encoded into mount-path. Request.getRequestParameters() does not contain parameters encoded into mount-path. So there are no work-around for this issue.
> ** HOW TO FIX THIS ISSUE **
> We must return null from getStoredPage(int) method of PageProvider class, if current PageParameters is not same with the PageParameters of a stored page. In current code, getStoredPage(int) checks only if the class of both pages are same. We must check the PageParameters of both pages.
> ** PATCH **
> I attached a pache for PageProvider class. try it.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Assigned] (WICKET-4441) PageProvider should create a new Page instance if PageParameters are changed, even if a stored page exists.

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

Martin Grigorov reassigned WICKET-4441:
---------------------------------------

    Assignee: Martin Grigorov
    
> PageProvider should create a new Page instance if PageParameters are changed, even if a stored page exists.
> -----------------------------------------------------------------------------------------------------------
>
>                 Key: WICKET-4441
>                 URL: https://issues.apache.org/jira/browse/WICKET-4441
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>    Affects Versions: 1.5.5
>         Environment: all platform.
>            Reporter: Tsutomu YANO
>            Assignee: Martin Grigorov
>         Attachments: fix-WICKET-4441.patch, pagebug.tar.gz, pagebug2.tar.gz
>
>
> The 'getStoredPage(int)' method returns a stored page instance even if user changes parameter values encoded into URL, and the PageParameters object of the stored page instance is never changed. So same page is displayed always though user changes url on browser manually.
> ** HOW TO REPRODUCT **
> 1. unpack the attached sample project 'pagebug.tar.gz'.
> 2. mvn jetty:run
> 3. access to http://localhost:8080/user/user1
> You will see a form filled with information about user 1. The user's name is 'user 1', age is 30 and country is 'Japan'.
> The mount path of this page is '/user/${userId}'. so 'user1' in the accessed url is a parameter value.
> after accessing to the url, the url will be changed to http://localhost:8080/user/user1?0 .  it contains the page id of the currently displayed page.
> 4. change some values and submit the form. page id will be changed on every submit.
> 5. change only parameter value in url to 'user2'. Never change page-id.
> for example, if you now access to http://localhost:8080/user/user1?5, change the url to http://localhost:8080/user/user2?5 .
> 6. This program must display information about user2, because the parameter value of url is changed. But you will see the information of user 1. Wicket always display the page of page-id = 5 (even though user changed url manually).
> In this sample program, I use LoadableDetachableModel for retrieving current parameter-value. But I don't get the new parameter-value because pageParameters object in a page instance is never changed after the construction. pageParameters is fixed in the constructor of Page class.
> I think that there are no easy way to retrieve parameter-values encoded into mount-path. Request.getRequestParameters() does not contain parameters encoded into mount-path. So there are no work-around for this issue.
> ** HOW TO FIX THIS ISSUE **
> We must return null from getStoredPage(int) method of PageProvider class, if current PageParameters is not same with the PageParameters of a stored page. In current code, getStoredPage(int) checks only if the class of both pages are same. We must check the PageParameters of both pages.
> ** PATCH **
> I attached a pache for PageProvider class. try it.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (WICKET-4441) PageProvider should create a new Page instance if PageParameters are changed, even if a stored page exists.

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

Tsutomu YANO updated WICKET-4441:
---------------------------------

    Description: 
The 'getStoredPage(int)' method returns a stored page instance even if user changes parameter values encoded into URL, and the PageParameters object of the stored page instance is never changed. So same page is displayed always though user changes url on browser manually.

** HOW TO REPRODUCT **

1. unpack the attached sample project 'pagebug.tar.gz'.
2. mvn jetty:run
3. access to http://localhost:8080/user/user1

You will see a form filled with information about user 1. The user's name is 'user 1', age is 30 and country is 'Japan'.
The mount path of this page is '/user/${userId}'. so 'user1' in the accessed url is a parameter value.

after accessing to the url, the url will be changed to 'http://localhost:8080/user/user1?0'.  it contains the page id of the currently displayed page.

4. change some values and submit the form. page id will be changed on every submit.

5. change only parameter value in url to 'user2'. Never change page-id.

for example, if you now access to 'http://localhost:8080/user/user1?5', change the url to 'http://localhost:8080/user/user2?5' .

6. This program must display information about user2, because the parameter value of url is changed. But you will see the information of user 1. Wicket always display the page of page-id = 5 (even though user changed url manually).

In this sample program, I use LoadableDetachableModel for retrieving current parameter-value. But I don't get the new parameter-value because pageParameters object in a page instance is never changed after the construction. pageParameters is fixed in the constructor of Page class.

I think that there are no easy way to retrieve parameter-values encoded into mount-path. Request.getRequestParameters() does not contain parameters encoded into mount-path. So there are no work-around for this issue.


** HOW TO FIX THIS ISSUE **

We must return null from getStoredPage(int) method of PageProvider class, if current PageParameters is not same with the PageParameters of a stored page. In current code, getStoredPage(int) checks only if the class of both pages are same. We must check the PageParameters of both pages.


** PATCH **

I attached a pache for PageProvider class. try it.




  was:
The 'getStoredPage(int)' method returns a stored page instance even if user changes parameter values encoded into URL, and the PageParameters object of the stored page instance is never changed. So same page is displayed always though user changes url on browser manually.

** HOW TO REPRODUCT **

1. unpack the attached sample project 'pagebug.zip'.
2. mvn jetty:run
3. access to http://localhost:8080/user/user1

You will see a form filled with information about user 1. The user's name is 'user 1', age is 30 and country is 'Japan'.
The mount path of this page is '/user/${userId}'. so 'user1' in the accessed url is a parameter value.

after accessing to the url, the url will be changed to 'http://localhost:8080/user/user1?0'.  it contains the page id of the currently displayed page.

4. change some values and submit the form. page id will be changed on every submit.

5. change only parameter value in url to 'user2'. Never change page-id.

for example, if you now access to 'http://localhost:8080/user/user1?5', change the url to 'http://localhost:8080/user/user2?5' .

6. This program must display information about user2, because the parameter value of url is changed. But you will see the information of user 1. Wicket always display the page of page-id = 5 (even though user changed url manually).

In this sample program, I use LoadableDetachableModel for retrieving current parameter-value. But I don't get the new parameter-value because pageParameters object in a page instance is never changed after the construction. pageParameters is fixed in the constructor of Page class.

I think that there are no easy way to retrieve parameter-values encoded into mount-path. Request.getRequestParameters() does not contain parameters encoded into mount-path. So there are no work-around for this issue.


** HOW TO FIX THIS ISSUE **

We must return null from getStoredPage(int) method of PageProvider class, if current PageParameters is not same with the PageParameters of a stored page. In current code, getStoredPage(int) checks only if the class of both pages are same. We must check the PageParameters of both pages.


** PATCH **

I attached a pache for PageProvider class. try it.




    
> PageProvider should create a new Page instance if PageParameters are changed, even if a stored page exists.
> -----------------------------------------------------------------------------------------------------------
>
>                 Key: WICKET-4441
>                 URL: https://issues.apache.org/jira/browse/WICKET-4441
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>    Affects Versions: 1.5.5
>         Environment: all platform.
>            Reporter: Tsutomu YANO
>
> The 'getStoredPage(int)' method returns a stored page instance even if user changes parameter values encoded into URL, and the PageParameters object of the stored page instance is never changed. So same page is displayed always though user changes url on browser manually.
> ** HOW TO REPRODUCT **
> 1. unpack the attached sample project 'pagebug.tar.gz'.
> 2. mvn jetty:run
> 3. access to http://localhost:8080/user/user1
> You will see a form filled with information about user 1. The user's name is 'user 1', age is 30 and country is 'Japan'.
> The mount path of this page is '/user/${userId}'. so 'user1' in the accessed url is a parameter value.
> after accessing to the url, the url will be changed to 'http://localhost:8080/user/user1?0'.  it contains the page id of the currently displayed page.
> 4. change some values and submit the form. page id will be changed on every submit.
> 5. change only parameter value in url to 'user2'. Never change page-id.
> for example, if you now access to 'http://localhost:8080/user/user1?5', change the url to 'http://localhost:8080/user/user2?5' .
> 6. This program must display information about user2, because the parameter value of url is changed. But you will see the information of user 1. Wicket always display the page of page-id = 5 (even though user changed url manually).
> In this sample program, I use LoadableDetachableModel for retrieving current parameter-value. But I don't get the new parameter-value because pageParameters object in a page instance is never changed after the construction. pageParameters is fixed in the constructor of Page class.
> I think that there are no easy way to retrieve parameter-values encoded into mount-path. Request.getRequestParameters() does not contain parameters encoded into mount-path. So there are no work-around for this issue.
> ** HOW TO FIX THIS ISSUE **
> We must return null from getStoredPage(int) method of PageProvider class, if current PageParameters is not same with the PageParameters of a stored page. In current code, getStoredPage(int) checks only if the class of both pages are same. We must check the PageParameters of both pages.
> ** PATCH **
> I attached a pache for PageProvider class. try it.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (WICKET-4441) PageProvider should create a new Page instance if PageParameters are changed, even if a stored page exists.

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

Tsutomu YANO commented on WICKET-4441:
--------------------------------------

I know that the PageParameters object is that contains the GET parameters which ware available when the page was created, because it is described in Javadoc. Truly, THAT was a reason I post this issue as a BUG.

Before I post this issue, same as you wrote in previous post, I thought that I could get the new parameter-value from getRequest().getRequestParameters(). But I couldn't, because getRequest().getRequestParameters() doesn't contain the parameters which encoded into mount-path like '/mount-path/${parameter-name}', but it contains only current query-parameters and post-parameters. Because the encoded parameters are not query-parameters nor post-parameters.  Simplly a part of url.

I attach a new sample project where I log all parameter-keys and values of getRequest().getRequestParameter() in onBeforeRender().  That doesn't contain the parameters encoded into mount-path.

(Note: a attached project references wicket 1.5.4 statically for testing. But same with wicket-1.5-SNAPSHOT.)


Our problem is that we have no way to easily get parameter-values from mount-path. We can get parameter-values of query-parameters and post-parameters, because wicket provide the way through getRequestParameters(), getQueryParameters() or getPostParameters(). But there is no way to get the parameters encoded into url.

The only way to retrieve the values from url is that we do same thing which MountedMapper do. Is it the right way to do that in wicket? I can not believe it. 

summary:

1. PageParameters is the object which contains the parameters which the page is created (it is decribed in JavaDoc, so we can not change the behavior easily).

2. getRequest().getRequestParameters() contains only query-parameters and post-parameters, but doesn't contain parameters which encoded into url by mount-path (the function for encoding parameters into URL is introduced from wicket 1.5, so older versions don't have this issue, I think.).

3. There is no easy way to retrieve parameter-values from URL (I think the only way is doing same thing MountedMapper do).

4. So the only easily implementable and ligically acceptable way to provide ALL CURRENT parameters (including parameters encoded into url) for users is that we reconstruct a new page if a part of parameters is changed. Users can all current parameters from PageParameters.

If URL is changed, the page object is newly created. Parameters encoded into URL are a part of URL, so it is acceptable for me.

If there are another easy ways already, this ticket is my mistake, but I could not find them. I think, if creating a new page instance for each parameter-change is not acceptable for you, (I hope) you should provide another way to retrieve ALL CURRENT PARAMETER VALUES easily for our users of Wicket. We can retrieve query-parameters and post-parameters easily, but not parameters encoded into url.


                
> PageProvider should create a new Page instance if PageParameters are changed, even if a stored page exists.
> -----------------------------------------------------------------------------------------------------------
>
>                 Key: WICKET-4441
>                 URL: https://issues.apache.org/jira/browse/WICKET-4441
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>    Affects Versions: 1.5.5
>         Environment: all platform.
>            Reporter: Tsutomu YANO
>         Attachments: fix-WICKET-4441.patch, pagebug.tar.gz, pagebug2.tar.gz
>
>
> The 'getStoredPage(int)' method returns a stored page instance even if user changes parameter values encoded into URL, and the PageParameters object of the stored page instance is never changed. So same page is displayed always though user changes url on browser manually.
> ** HOW TO REPRODUCT **
> 1. unpack the attached sample project 'pagebug.tar.gz'.
> 2. mvn jetty:run
> 3. access to http://localhost:8080/user/user1
> You will see a form filled with information about user 1. The user's name is 'user 1', age is 30 and country is 'Japan'.
> The mount path of this page is '/user/${userId}'. so 'user1' in the accessed url is a parameter value.
> after accessing to the url, the url will be changed to http://localhost:8080/user/user1?0 .  it contains the page id of the currently displayed page.
> 4. change some values and submit the form. page id will be changed on every submit.
> 5. change only parameter value in url to 'user2'. Never change page-id.
> for example, if you now access to http://localhost:8080/user/user1?5, change the url to http://localhost:8080/user/user2?5 .
> 6. This program must display information about user2, because the parameter value of url is changed. But you will see the information of user 1. Wicket always display the page of page-id = 5 (even though user changed url manually).
> In this sample program, I use LoadableDetachableModel for retrieving current parameter-value. But I don't get the new parameter-value because pageParameters object in a page instance is never changed after the construction. pageParameters is fixed in the constructor of Page class.
> I think that there are no easy way to retrieve parameter-values encoded into mount-path. Request.getRequestParameters() does not contain parameters encoded into mount-path. So there are no work-around for this issue.
> ** HOW TO FIX THIS ISSUE **
> We must return null from getStoredPage(int) method of PageProvider class, if current PageParameters is not same with the PageParameters of a stored page. In current code, getStoredPage(int) checks only if the class of both pages are same. We must check the PageParameters of both pages.
> ** PATCH **
> I attached a pache for PageProvider class. try it.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Resolved] (WICKET-4441) PageProvider should create a new Page instance if PageParameters are changed, even if a stored page exists.

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

Martin Grigorov resolved WICKET-4441.
-------------------------------------

    Resolution: Invalid
    
> PageProvider should create a new Page instance if PageParameters are changed, even if a stored page exists.
> -----------------------------------------------------------------------------------------------------------
>
>                 Key: WICKET-4441
>                 URL: https://issues.apache.org/jira/browse/WICKET-4441
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>    Affects Versions: 1.5.5
>         Environment: all platform.
>            Reporter: Tsutomu YANO
>         Attachments: fix-WICKET-4441.patch, pagebug.tar.gz
>
>
> The 'getStoredPage(int)' method returns a stored page instance even if user changes parameter values encoded into URL, and the PageParameters object of the stored page instance is never changed. So same page is displayed always though user changes url on browser manually.
> ** HOW TO REPRODUCT **
> 1. unpack the attached sample project 'pagebug.tar.gz'.
> 2. mvn jetty:run
> 3. access to http://localhost:8080/user/user1
> You will see a form filled with information about user 1. The user's name is 'user 1', age is 30 and country is 'Japan'.
> The mount path of this page is '/user/${userId}'. so 'user1' in the accessed url is a parameter value.
> after accessing to the url, the url will be changed to http://localhost:8080/user/user1?0 .  it contains the page id of the currently displayed page.
> 4. change some values and submit the form. page id will be changed on every submit.
> 5. change only parameter value in url to 'user2'. Never change page-id.
> for example, if you now access to http://localhost:8080/user/user1?5, change the url to http://localhost:8080/user/user2?5 .
> 6. This program must display information about user2, because the parameter value of url is changed. But you will see the information of user 1. Wicket always display the page of page-id = 5 (even though user changed url manually).
> In this sample program, I use LoadableDetachableModel for retrieving current parameter-value. But I don't get the new parameter-value because pageParameters object in a page instance is never changed after the construction. pageParameters is fixed in the constructor of Page class.
> I think that there are no easy way to retrieve parameter-values encoded into mount-path. Request.getRequestParameters() does not contain parameters encoded into mount-path. So there are no work-around for this issue.
> ** HOW TO FIX THIS ISSUE **
> We must return null from getStoredPage(int) method of PageProvider class, if current PageParameters is not same with the PageParameters of a stored page. In current code, getStoredPage(int) checks only if the class of both pages are same. We must check the PageParameters of both pages.
> ** PATCH **
> I attached a pache for PageProvider class. try it.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (WICKET-4441) PageProvider should create a new Page instance if PageParameters are changed, even if a stored page exists.

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

Martin Grigorov commented on WICKET-4441:
-----------------------------------------

I think this issue is Invalid.
Why: PageParameters is an object that contains the request GET parameters which were available when the page instance was created. After that the subsequent requests (like form submittion, link click, ...) may have their own parameters which should not override the page's parameters. To get to those parameters you should use getRequest().getRequestParameters().
To support your use case you need to re-read getRequest().getRequestParameters() in onBeforeRender(). Or use CORS Model's which read their values from getRequest().getRequestParameters() but write somewhere else.

I agree that this is not very clear. And even Wicket makes it more confusing by passing Attributes parameter to some callback methods which provide Request, Response and PageParameters as inner objects. These PageParameters instances are "the current request parameters", not the Page's parameters. But it is a bit late to change that... :-/
                
> PageProvider should create a new Page instance if PageParameters are changed, even if a stored page exists.
> -----------------------------------------------------------------------------------------------------------
>
>                 Key: WICKET-4441
>                 URL: https://issues.apache.org/jira/browse/WICKET-4441
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>    Affects Versions: 1.5.5
>         Environment: all platform.
>            Reporter: Tsutomu YANO
>         Attachments: fix-WICKET-4441.patch, pagebug.tar.gz
>
>
> The 'getStoredPage(int)' method returns a stored page instance even if user changes parameter values encoded into URL, and the PageParameters object of the stored page instance is never changed. So same page is displayed always though user changes url on browser manually.
> ** HOW TO REPRODUCT **
> 1. unpack the attached sample project 'pagebug.tar.gz'.
> 2. mvn jetty:run
> 3. access to http://localhost:8080/user/user1
> You will see a form filled with information about user 1. The user's name is 'user 1', age is 30 and country is 'Japan'.
> The mount path of this page is '/user/${userId}'. so 'user1' in the accessed url is a parameter value.
> after accessing to the url, the url will be changed to http://localhost:8080/user/user1?0 .  it contains the page id of the currently displayed page.
> 4. change some values and submit the form. page id will be changed on every submit.
> 5. change only parameter value in url to 'user2'. Never change page-id.
> for example, if you now access to http://localhost:8080/user/user1?5, change the url to http://localhost:8080/user/user2?5 .
> 6. This program must display information about user2, because the parameter value of url is changed. But you will see the information of user 1. Wicket always display the page of page-id = 5 (even though user changed url manually).
> In this sample program, I use LoadableDetachableModel for retrieving current parameter-value. But I don't get the new parameter-value because pageParameters object in a page instance is never changed after the construction. pageParameters is fixed in the constructor of Page class.
> I think that there are no easy way to retrieve parameter-values encoded into mount-path. Request.getRequestParameters() does not contain parameters encoded into mount-path. So there are no work-around for this issue.
> ** HOW TO FIX THIS ISSUE **
> We must return null from getStoredPage(int) method of PageProvider class, if current PageParameters is not same with the PageParameters of a stored page. In current code, getStoredPage(int) checks only if the class of both pages are same. We must check the PageParameters of both pages.
> ** PATCH **
> I attached a pache for PageProvider class. try it.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Assigned] (WICKET-4441) PageProvider should create a new Page instance if PageParameters are changed, even if a stored page exists.

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

Martin Grigorov reassigned WICKET-4441:
---------------------------------------

    Assignee:     (was: Martin Grigorov)
    
> PageProvider should create a new Page instance if PageParameters are changed, even if a stored page exists.
> -----------------------------------------------------------------------------------------------------------
>
>                 Key: WICKET-4441
>                 URL: https://issues.apache.org/jira/browse/WICKET-4441
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>    Affects Versions: 1.5.5
>         Environment: all platform.
>            Reporter: Tsutomu YANO
>         Attachments: WICKET-4441.patch, fix-WICKET-4441.patch, pagebug.tar.gz, pagebug2.tar.gz
>
>
> The 'getStoredPage(int)' method returns a stored page instance even if user changes parameter values encoded into URL, and the PageParameters object of the stored page instance is never changed. So same page is displayed always though user changes url on browser manually.
> ** HOW TO REPRODUCT **
> 1. unpack the attached sample project 'pagebug.tar.gz'.
> 2. mvn jetty:run
> 3. access to http://localhost:8080/user/user1
> You will see a form filled with information about user 1. The user's name is 'user 1', age is 30 and country is 'Japan'.
> The mount path of this page is '/user/${userId}'. so 'user1' in the accessed url is a parameter value.
> after accessing to the url, the url will be changed to http://localhost:8080/user/user1?0 .  it contains the page id of the currently displayed page.
> 4. change some values and submit the form. page id will be changed on every submit.
> 5. change only parameter value in url to 'user2'. Never change page-id.
> for example, if you now access to http://localhost:8080/user/user1?5, change the url to http://localhost:8080/user/user2?5 .
> 6. This program must display information about user2, because the parameter value of url is changed. But you will see the information of user 1. Wicket always display the page of page-id = 5 (even though user changed url manually).
> In this sample program, I use LoadableDetachableModel for retrieving current parameter-value. But I don't get the new parameter-value because pageParameters object in a page instance is never changed after the construction. pageParameters is fixed in the constructor of Page class.
> I think that there are no easy way to retrieve parameter-values encoded into mount-path. Request.getRequestParameters() does not contain parameters encoded into mount-path. So there are no work-around for this issue.
> ** HOW TO FIX THIS ISSUE **
> We must return null from getStoredPage(int) method of PageProvider class, if current PageParameters is not same with the PageParameters of a stored page. In current code, getStoredPage(int) checks only if the class of both pages are same. We must check the PageParameters of both pages.
> ** PATCH **
> I attached a pache for PageProvider class. try it.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (WICKET-4441) PageProvider should create a new Page instance if PageParameters are changed, even if a stored page exists.

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

Tsutomu YANO updated WICKET-4441:
---------------------------------

    Description: 
The 'getStoredPage(int)' method returns a stored page instance even if user changes parameter values encoded into URL, and the PageParameters object of the stored page instance is never changed. So same page is displayed always though user changes url on browser manually.

** HOW TO REPRODUCT **

1. unpack the attached sample project 'pagebug.tar.gz'.
2. mvn jetty:run
3. access to http://localhost:8080/user/user1

You will see a form filled with information about user 1. The user's name is 'user 1', age is 30 and country is 'Japan'.
The mount path of this page is '/user/${userId}'. so 'user1' in the accessed url is a parameter value.

after accessing to the url, the url will be changed to http://localhost:8080/user/user1?0 .  it contains the page id of the currently displayed page.

4. change some values and submit the form. page id will be changed on every submit.

5. change only parameter value in url to 'user2'. Never change page-id.

for example, if you now access to http://localhost:8080/user/user1?5, change the url to http://localhost:8080/user/user2?5 .

6. This program must display information about user2, because the parameter value of url is changed. But you will see the information of user 1. Wicket always display the page of page-id = 5 (even though user changed url manually).

In this sample program, I use LoadableDetachableModel for retrieving current parameter-value. But I don't get the new parameter-value because pageParameters object in a page instance is never changed after the construction. pageParameters is fixed in the constructor of Page class.

I think that there are no easy way to retrieve parameter-values encoded into mount-path. Request.getRequestParameters() does not contain parameters encoded into mount-path. So there are no work-around for this issue.


** HOW TO FIX THIS ISSUE **

We must return null from getStoredPage(int) method of PageProvider class, if current PageParameters is not same with the PageParameters of a stored page. In current code, getStoredPage(int) checks only if the class of both pages are same. We must check the PageParameters of both pages.


** PATCH **

I attached a pache for PageProvider class. try it.




  was:
The 'getStoredPage(int)' method returns a stored page instance even if user changes parameter values encoded into URL, and the PageParameters object of the stored page instance is never changed. So same page is displayed always though user changes url on browser manually.

** HOW TO REPRODUCT **

1. unpack the attached sample project 'pagebug.tar.gz'.
2. mvn jetty:run
3. access to http://localhost:8080/user/user1

You will see a form filled with information about user 1. The user's name is 'user 1', age is 30 and country is 'Japan'.
The mount path of this page is '/user/${userId}'. so 'user1' in the accessed url is a parameter value.

after accessing to the url, the url will be changed to 'http://localhost:8080/user/user1?0'.  it contains the page id of the currently displayed page.

4. change some values and submit the form. page id will be changed on every submit.

5. change only parameter value in url to 'user2'. Never change page-id.

for example, if you now access to 'http://localhost:8080/user/user1?5', change the url to 'http://localhost:8080/user/user2?5' .

6. This program must display information about user2, because the parameter value of url is changed. But you will see the information of user 1. Wicket always display the page of page-id = 5 (even though user changed url manually).

In this sample program, I use LoadableDetachableModel for retrieving current parameter-value. But I don't get the new parameter-value because pageParameters object in a page instance is never changed after the construction. pageParameters is fixed in the constructor of Page class.

I think that there are no easy way to retrieve parameter-values encoded into mount-path. Request.getRequestParameters() does not contain parameters encoded into mount-path. So there are no work-around for this issue.


** HOW TO FIX THIS ISSUE **

We must return null from getStoredPage(int) method of PageProvider class, if current PageParameters is not same with the PageParameters of a stored page. In current code, getStoredPage(int) checks only if the class of both pages are same. We must check the PageParameters of both pages.


** PATCH **

I attached a pache for PageProvider class. try it.




    
> PageProvider should create a new Page instance if PageParameters are changed, even if a stored page exists.
> -----------------------------------------------------------------------------------------------------------
>
>                 Key: WICKET-4441
>                 URL: https://issues.apache.org/jira/browse/WICKET-4441
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>    Affects Versions: 1.5.5
>         Environment: all platform.
>            Reporter: Tsutomu YANO
>         Attachments: fix-WICKET-4441.patch, pagebug.tar.gz
>
>
> The 'getStoredPage(int)' method returns a stored page instance even if user changes parameter values encoded into URL, and the PageParameters object of the stored page instance is never changed. So same page is displayed always though user changes url on browser manually.
> ** HOW TO REPRODUCT **
> 1. unpack the attached sample project 'pagebug.tar.gz'.
> 2. mvn jetty:run
> 3. access to http://localhost:8080/user/user1
> You will see a form filled with information about user 1. The user's name is 'user 1', age is 30 and country is 'Japan'.
> The mount path of this page is '/user/${userId}'. so 'user1' in the accessed url is a parameter value.
> after accessing to the url, the url will be changed to http://localhost:8080/user/user1?0 .  it contains the page id of the currently displayed page.
> 4. change some values and submit the form. page id will be changed on every submit.
> 5. change only parameter value in url to 'user2'. Never change page-id.
> for example, if you now access to http://localhost:8080/user/user1?5, change the url to http://localhost:8080/user/user2?5 .
> 6. This program must display information about user2, because the parameter value of url is changed. But you will see the information of user 1. Wicket always display the page of page-id = 5 (even though user changed url manually).
> In this sample program, I use LoadableDetachableModel for retrieving current parameter-value. But I don't get the new parameter-value because pageParameters object in a page instance is never changed after the construction. pageParameters is fixed in the constructor of Page class.
> I think that there are no easy way to retrieve parameter-values encoded into mount-path. Request.getRequestParameters() does not contain parameters encoded into mount-path. So there are no work-around for this issue.
> ** HOW TO FIX THIS ISSUE **
> We must return null from getStoredPage(int) method of PageProvider class, if current PageParameters is not same with the PageParameters of a stored page. In current code, getStoredPage(int) checks only if the class of both pages are same. We must check the PageParameters of both pages.
> ** PATCH **
> I attached a pache for PageProvider class. try it.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (WICKET-4441) PageProvider should create a new Page instance if PageParameters are changed, even if a stored page exists.

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

Tsutomu YANO updated WICKET-4441:
---------------------------------

    Attachment: fix-WICKET-4441.patch
    
> PageProvider should create a new Page instance if PageParameters are changed, even if a stored page exists.
> -----------------------------------------------------------------------------------------------------------
>
>                 Key: WICKET-4441
>                 URL: https://issues.apache.org/jira/browse/WICKET-4441
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>    Affects Versions: 1.5.5
>         Environment: all platform.
>            Reporter: Tsutomu YANO
>         Attachments: fix-WICKET-4441.patch, pagebug.tar.gz
>
>
> The 'getStoredPage(int)' method returns a stored page instance even if user changes parameter values encoded into URL, and the PageParameters object of the stored page instance is never changed. So same page is displayed always though user changes url on browser manually.
> ** HOW TO REPRODUCT **
> 1. unpack the attached sample project 'pagebug.tar.gz'.
> 2. mvn jetty:run
> 3. access to http://localhost:8080/user/user1
> You will see a form filled with information about user 1. The user's name is 'user 1', age is 30 and country is 'Japan'.
> The mount path of this page is '/user/${userId}'. so 'user1' in the accessed url is a parameter value.
> after accessing to the url, the url will be changed to 'http://localhost:8080/user/user1?0'.  it contains the page id of the currently displayed page.
> 4. change some values and submit the form. page id will be changed on every submit.
> 5. change only parameter value in url to 'user2'. Never change page-id.
> for example, if you now access to 'http://localhost:8080/user/user1?5', change the url to 'http://localhost:8080/user/user2?5' .
> 6. This program must display information about user2, because the parameter value of url is changed. But you will see the information of user 1. Wicket always display the page of page-id = 5 (even though user changed url manually).
> In this sample program, I use LoadableDetachableModel for retrieving current parameter-value. But I don't get the new parameter-value because pageParameters object in a page instance is never changed after the construction. pageParameters is fixed in the constructor of Page class.
> I think that there are no easy way to retrieve parameter-values encoded into mount-path. Request.getRequestParameters() does not contain parameters encoded into mount-path. So there are no work-around for this issue.
> ** HOW TO FIX THIS ISSUE **
> We must return null from getStoredPage(int) method of PageProvider class, if current PageParameters is not same with the PageParameters of a stored page. In current code, getStoredPage(int) checks only if the class of both pages are same. We must check the PageParameters of both pages.
> ** PATCH **
> I attached a pache for PageProvider class. try it.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira