You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by "Stijn Geukens (Created) (JIRA)" <ji...@apache.org> on 2012/01/25 15:20:42 UTC

[jira] [Created] (WICKET-4360) Wicket reloading old page id on page refresh

Wicket reloading old page id on page refresh
--------------------------------------------

                 Key: WICKET-4360
                 URL: https://issues.apache.org/jira/browse/WICKET-4360
             Project: Wicket
          Issue Type: Bug
          Components: wicket
    Affects Versions: 1.5.3
         Environment: Windows & linux, jetty 7 & WAS 7
            Reporter: Stijn Geukens



This issue was first reported on StackOverflow but after further investigation it is possible that this is a bug:

http://stackoverflow.com/questions/8985785/wicket-serialization-deserialization-issue

I added following to my Page class:

	private void writeObject(ObjectOutputStream oos) throws IOException {
		oos.defaultWriteObject();
		System.err.println("Writing " + this + something to print out the type of the filter);
	}

	private void readObject(ObjectInputStream ois) throws ClassNotFoundException, IOException {
		ois.defaultReadObject();
		System.err.println("Reading " + this + something to print out the type of the filter); 
	}

1. When the Page is loaded first it prints (actually it prints this 5 times, not sure if it's normal):
Writing [Page class = com.bnpp.ecom.homepage.web.Homepage, id = 0, render count = 1]: type = ALL

2. When I click on AjaxLink 'ALL' (that will update the filter) it still prints:
Writing [Page class = com.bnpp.ecom.homepage.web.Homepage, id = 0, render count = 1]: type = ALL

3. When I click on AjaxLink 'DISCUSSIONS' (that will update the filter) it still prints:
Writing [Page class = com.bnpp.ecom.homepage.web.Homepage, id = 0, render count = 1]: type = DISCUSSIONS

4. When I refresh the page (F5) the pageid is updated:
Writing [Page class = com.bnpp.ecom.homepage.web.Homepage, id = 1, render count = 2]: type = DISCUSSIONS

The url however does not change, it stays http://.../?0

5. When I click on AjaxLink 'ALL' (that will update the filter) it prints:
Writing [Page class = com.bnpp.ecom.homepage.web.Homepage, id = 1, render count = 1]: type = ALL

So far so good but
6. When I refresh the page now (F5) this is printed out:
Reading [Page class = com.bnpp.ecom.homepage.web.Homepage, id = 0, render count = 1]: type = DISCUSSIONS
Writing [Page class = com.bnpp.ecom.homepage.web.Homepage, id = 2, render count = 2]: type = DISCUSSIONS

So it deserializes the page with id 0 although the last known page id was 1 and all changes that were done for version 1 are ignored (in this case switching the type from DISCUSSIONS to ALL).

--
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-4360) Wicket reloading old page id on page refresh

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

Stijn Geukens commented on WICKET-4360:
---------------------------------------

To reproduce:

1. Open url
    => Type 1 is selected (bold)
2. Click on 'Type 2'
    => Type 2 is selected
3. Refresh (F5) page
    => Type 2 is still selected
    => page id is incremented (0 -> 1) but in url it is still ?0 (see logging)
4. Click on 'Type 1)
    => Type 1 is selected
5. Refresh page
    => Logging: page with id 0 is deserialised and page id is incremented by 1 (1 -> 2)
    => Type 2 is selected instead of expected (last clicked) Type 1

                
> Wicket reloading old page id on page refresh
> --------------------------------------------
>
>                 Key: WICKET-4360
>                 URL: https://issues.apache.org/jira/browse/WICKET-4360
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>    Affects Versions: 1.5.3
>         Environment: Windows & linux, jetty 7 & WAS 7
>            Reporter: Stijn Geukens
>         Attachments: wicket4360.zip
>
>
> This issue was first reported on StackOverflow but after further investigation it is possible that this is a bug:
> http://stackoverflow.com/questions/8985785/wicket-serialization-deserialization-issue
> I added following to my Page class:
> 	private void writeObject(ObjectOutputStream oos) throws IOException {
> 		oos.defaultWriteObject();
> 		System.err.println("Writing " + this + something to print out the type of the filter);
> 	}
> 	private void readObject(ObjectInputStream ois) throws ClassNotFoundException, IOException {
> 		ois.defaultReadObject();
> 		System.err.println("Reading " + this + something to print out the type of the filter); 
> 	}
> 1. When the Page is loaded first it prints (actually it prints this 5 times, not sure if it's normal):
> Writing [Page class = com.bnpp.ecom.homepage.web.Homepage, id = 0, render count = 1]: type = ALL
> 2. When I click on AjaxLink 'ALL' (that will update the filter) it still prints:
> Writing [Page class = com.bnpp.ecom.homepage.web.Homepage, id = 0, render count = 1]: type = ALL
> 3. When I click on AjaxLink 'DISCUSSIONS' (that will update the filter) it still prints:
> Writing [Page class = com.bnpp.ecom.homepage.web.Homepage, id = 0, render count = 1]: type = DISCUSSIONS
> 4. When I refresh the page (F5) the pageid is updated:
> Writing [Page class = com.bnpp.ecom.homepage.web.Homepage, id = 1, render count = 2]: type = DISCUSSIONS
> The url however does not change, it stays http://.../?0
> 5. When I click on AjaxLink 'ALL' (that will update the filter) it prints:
> Writing [Page class = com.bnpp.ecom.homepage.web.Homepage, id = 1, render count = 1]: type = ALL
> So far so good but
> 6. When I refresh the page now (F5) this is printed out:
> Reading [Page class = com.bnpp.ecom.homepage.web.Homepage, id = 0, render count = 1]: type = DISCUSSIONS
> Writing [Page class = com.bnpp.ecom.homepage.web.Homepage, id = 2, render count = 2]: type = DISCUSSIONS
> So it deserializes the page with id 0 although the last known page id was 1 and all changes that were done for version 1 are ignored (in this case switching the type from DISCUSSIONS to ALL).

--
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-4360) Wicket reloading old page id on page refresh

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

Martin Grigorov resolved WICKET-4360.
-------------------------------------

    Resolution: Not A Problem

On F5 Wicket reads (once) the current page.
But then it writes a the page with a new page id because of the usage of ListView (PropertyListView in DataPanel).
By adding "commentsListView.setReuseItems(true);" all is fine.
See WICKET-4286 for a discussion about the ListView problem. 
                
> Wicket reloading old page id on page refresh
> --------------------------------------------
>
>                 Key: WICKET-4360
>                 URL: https://issues.apache.org/jira/browse/WICKET-4360
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>    Affects Versions: 1.5.3
>         Environment: Windows & linux, jetty 7 & WAS 7
>            Reporter: Stijn Geukens
>         Attachments: wicket4360.zip
>
>
> This issue was first reported on StackOverflow but after further investigation it is possible that this is a bug:
> http://stackoverflow.com/questions/8985785/wicket-serialization-deserialization-issue
> I added following to my Page class:
> 	private void writeObject(ObjectOutputStream oos) throws IOException {
> 		oos.defaultWriteObject();
> 		System.err.println("Writing " + this + something to print out the type of the filter);
> 	}
> 	private void readObject(ObjectInputStream ois) throws ClassNotFoundException, IOException {
> 		ois.defaultReadObject();
> 		System.err.println("Reading " + this + something to print out the type of the filter); 
> 	}
> 1. When the Page is loaded first it prints (actually it prints this 5 times, not sure if it's normal):
> Writing [Page class = com.bnpp.ecom.homepage.web.Homepage, id = 0, render count = 1]: type = ALL
> 2. When I click on AjaxLink 'ALL' (that will update the filter) it still prints:
> Writing [Page class = com.bnpp.ecom.homepage.web.Homepage, id = 0, render count = 1]: type = ALL
> 3. When I click on AjaxLink 'DISCUSSIONS' (that will update the filter) it still prints:
> Writing [Page class = com.bnpp.ecom.homepage.web.Homepage, id = 0, render count = 1]: type = DISCUSSIONS
> 4. When I refresh the page (F5) the pageid is updated:
> Writing [Page class = com.bnpp.ecom.homepage.web.Homepage, id = 1, render count = 2]: type = DISCUSSIONS
> The url however does not change, it stays http://.../?0
> 5. When I click on AjaxLink 'ALL' (that will update the filter) it prints:
> Writing [Page class = com.bnpp.ecom.homepage.web.Homepage, id = 1, render count = 1]: type = ALL
> So far so good but
> 6. When I refresh the page now (F5) this is printed out:
> Reading [Page class = com.bnpp.ecom.homepage.web.Homepage, id = 0, render count = 1]: type = DISCUSSIONS
> Writing [Page class = com.bnpp.ecom.homepage.web.Homepage, id = 2, render count = 2]: type = DISCUSSIONS
> So it deserializes the page with id 0 although the last known page id was 1 and all changes that were done for version 1 are ignored (in this case switching the type from DISCUSSIONS to ALL).

--
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-4360) Wicket reloading old page id on page refresh

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

Martin Grigorov commented on WICKET-4360:
-----------------------------------------

Can you attach a quickstart app please ?
                
> Wicket reloading old page id on page refresh
> --------------------------------------------
>
>                 Key: WICKET-4360
>                 URL: https://issues.apache.org/jira/browse/WICKET-4360
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>    Affects Versions: 1.5.3
>         Environment: Windows & linux, jetty 7 & WAS 7
>            Reporter: Stijn Geukens
>
> This issue was first reported on StackOverflow but after further investigation it is possible that this is a bug:
> http://stackoverflow.com/questions/8985785/wicket-serialization-deserialization-issue
> I added following to my Page class:
> 	private void writeObject(ObjectOutputStream oos) throws IOException {
> 		oos.defaultWriteObject();
> 		System.err.println("Writing " + this + something to print out the type of the filter);
> 	}
> 	private void readObject(ObjectInputStream ois) throws ClassNotFoundException, IOException {
> 		ois.defaultReadObject();
> 		System.err.println("Reading " + this + something to print out the type of the filter); 
> 	}
> 1. When the Page is loaded first it prints (actually it prints this 5 times, not sure if it's normal):
> Writing [Page class = com.bnpp.ecom.homepage.web.Homepage, id = 0, render count = 1]: type = ALL
> 2. When I click on AjaxLink 'ALL' (that will update the filter) it still prints:
> Writing [Page class = com.bnpp.ecom.homepage.web.Homepage, id = 0, render count = 1]: type = ALL
> 3. When I click on AjaxLink 'DISCUSSIONS' (that will update the filter) it still prints:
> Writing [Page class = com.bnpp.ecom.homepage.web.Homepage, id = 0, render count = 1]: type = DISCUSSIONS
> 4. When I refresh the page (F5) the pageid is updated:
> Writing [Page class = com.bnpp.ecom.homepage.web.Homepage, id = 1, render count = 2]: type = DISCUSSIONS
> The url however does not change, it stays http://.../?0
> 5. When I click on AjaxLink 'ALL' (that will update the filter) it prints:
> Writing [Page class = com.bnpp.ecom.homepage.web.Homepage, id = 1, render count = 1]: type = ALL
> So far so good but
> 6. When I refresh the page now (F5) this is printed out:
> Reading [Page class = com.bnpp.ecom.homepage.web.Homepage, id = 0, render count = 1]: type = DISCUSSIONS
> Writing [Page class = com.bnpp.ecom.homepage.web.Homepage, id = 2, render count = 2]: type = DISCUSSIONS
> So it deserializes the page with id 0 although the last known page id was 1 and all changes that were done for version 1 are ignored (in this case switching the type from DISCUSSIONS to ALL).

--
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-4360) Wicket reloading old page id on page refresh

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

Stijn Geukens commented on WICKET-4360:
---------------------------------------

ok, I'll try to reproduce it in a standalone simple app
                
> Wicket reloading old page id on page refresh
> --------------------------------------------
>
>                 Key: WICKET-4360
>                 URL: https://issues.apache.org/jira/browse/WICKET-4360
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>    Affects Versions: 1.5.3
>         Environment: Windows & linux, jetty 7 & WAS 7
>            Reporter: Stijn Geukens
>
> This issue was first reported on StackOverflow but after further investigation it is possible that this is a bug:
> http://stackoverflow.com/questions/8985785/wicket-serialization-deserialization-issue
> I added following to my Page class:
> 	private void writeObject(ObjectOutputStream oos) throws IOException {
> 		oos.defaultWriteObject();
> 		System.err.println("Writing " + this + something to print out the type of the filter);
> 	}
> 	private void readObject(ObjectInputStream ois) throws ClassNotFoundException, IOException {
> 		ois.defaultReadObject();
> 		System.err.println("Reading " + this + something to print out the type of the filter); 
> 	}
> 1. When the Page is loaded first it prints (actually it prints this 5 times, not sure if it's normal):
> Writing [Page class = com.bnpp.ecom.homepage.web.Homepage, id = 0, render count = 1]: type = ALL
> 2. When I click on AjaxLink 'ALL' (that will update the filter) it still prints:
> Writing [Page class = com.bnpp.ecom.homepage.web.Homepage, id = 0, render count = 1]: type = ALL
> 3. When I click on AjaxLink 'DISCUSSIONS' (that will update the filter) it still prints:
> Writing [Page class = com.bnpp.ecom.homepage.web.Homepage, id = 0, render count = 1]: type = DISCUSSIONS
> 4. When I refresh the page (F5) the pageid is updated:
> Writing [Page class = com.bnpp.ecom.homepage.web.Homepage, id = 1, render count = 2]: type = DISCUSSIONS
> The url however does not change, it stays http://.../?0
> 5. When I click on AjaxLink 'ALL' (that will update the filter) it prints:
> Writing [Page class = com.bnpp.ecom.homepage.web.Homepage, id = 1, render count = 1]: type = ALL
> So far so good but
> 6. When I refresh the page now (F5) this is printed out:
> Reading [Page class = com.bnpp.ecom.homepage.web.Homepage, id = 0, render count = 1]: type = DISCUSSIONS
> Writing [Page class = com.bnpp.ecom.homepage.web.Homepage, id = 2, render count = 2]: type = DISCUSSIONS
> So it deserializes the page with id 0 although the last known page id was 1 and all changes that were done for version 1 are ignored (in this case switching the type from DISCUSSIONS to ALL).

--
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-4360) Wicket reloading old page id on page refresh

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

Stijn Geukens updated WICKET-4360:
----------------------------------

    Attachment: wicket4360.zip

extract and run with mvn jetty:run
Navigate to http://localhost:8080/wicket4360 afterwards
                
> Wicket reloading old page id on page refresh
> --------------------------------------------
>
>                 Key: WICKET-4360
>                 URL: https://issues.apache.org/jira/browse/WICKET-4360
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>    Affects Versions: 1.5.3
>         Environment: Windows & linux, jetty 7 & WAS 7
>            Reporter: Stijn Geukens
>         Attachments: wicket4360.zip
>
>
> This issue was first reported on StackOverflow but after further investigation it is possible that this is a bug:
> http://stackoverflow.com/questions/8985785/wicket-serialization-deserialization-issue
> I added following to my Page class:
> 	private void writeObject(ObjectOutputStream oos) throws IOException {
> 		oos.defaultWriteObject();
> 		System.err.println("Writing " + this + something to print out the type of the filter);
> 	}
> 	private void readObject(ObjectInputStream ois) throws ClassNotFoundException, IOException {
> 		ois.defaultReadObject();
> 		System.err.println("Reading " + this + something to print out the type of the filter); 
> 	}
> 1. When the Page is loaded first it prints (actually it prints this 5 times, not sure if it's normal):
> Writing [Page class = com.bnpp.ecom.homepage.web.Homepage, id = 0, render count = 1]: type = ALL
> 2. When I click on AjaxLink 'ALL' (that will update the filter) it still prints:
> Writing [Page class = com.bnpp.ecom.homepage.web.Homepage, id = 0, render count = 1]: type = ALL
> 3. When I click on AjaxLink 'DISCUSSIONS' (that will update the filter) it still prints:
> Writing [Page class = com.bnpp.ecom.homepage.web.Homepage, id = 0, render count = 1]: type = DISCUSSIONS
> 4. When I refresh the page (F5) the pageid is updated:
> Writing [Page class = com.bnpp.ecom.homepage.web.Homepage, id = 1, render count = 2]: type = DISCUSSIONS
> The url however does not change, it stays http://.../?0
> 5. When I click on AjaxLink 'ALL' (that will update the filter) it prints:
> Writing [Page class = com.bnpp.ecom.homepage.web.Homepage, id = 1, render count = 1]: type = ALL
> So far so good but
> 6. When I refresh the page now (F5) this is printed out:
> Reading [Page class = com.bnpp.ecom.homepage.web.Homepage, id = 0, render count = 1]: type = DISCUSSIONS
> Writing [Page class = com.bnpp.ecom.homepage.web.Homepage, id = 2, render count = 2]: type = DISCUSSIONS
> So it deserializes the page with id 0 although the last known page id was 1 and all changes that were done for version 1 are ignored (in this case switching the type from DISCUSSIONS to ALL).

--
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-4360) Wicket reloading old page id on page refresh

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

Stijn Geukens commented on WICKET-4360:
---------------------------------------

Indeed, after setting reuseitems to true for all our Listviews (> 10 since it is a 1 page application with a lot of 'ajax panels') it works fine.
I see that if reuseitems is set to false then ListView.onPopuplate -> ListView.removeAll -> Component.addStateChange -> Page.componentStateChanging -> dirty() -> Page.setNextAvailableId().

overriding isVersioned to return false also does the trick but I'm not sure which solution would be better here?
                
> Wicket reloading old page id on page refresh
> --------------------------------------------
>
>                 Key: WICKET-4360
>                 URL: https://issues.apache.org/jira/browse/WICKET-4360
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>    Affects Versions: 1.5.3
>         Environment: Windows & linux, jetty 7 & WAS 7
>            Reporter: Stijn Geukens
>         Attachments: wicket4360.zip
>
>
> This issue was first reported on StackOverflow but after further investigation it is possible that this is a bug:
> http://stackoverflow.com/questions/8985785/wicket-serialization-deserialization-issue
> I added following to my Page class:
> 	private void writeObject(ObjectOutputStream oos) throws IOException {
> 		oos.defaultWriteObject();
> 		System.err.println("Writing " + this + something to print out the type of the filter);
> 	}
> 	private void readObject(ObjectInputStream ois) throws ClassNotFoundException, IOException {
> 		ois.defaultReadObject();
> 		System.err.println("Reading " + this + something to print out the type of the filter); 
> 	}
> 1. When the Page is loaded first it prints (actually it prints this 5 times, not sure if it's normal):
> Writing [Page class = com.bnpp.ecom.homepage.web.Homepage, id = 0, render count = 1]: type = ALL
> 2. When I click on AjaxLink 'ALL' (that will update the filter) it still prints:
> Writing [Page class = com.bnpp.ecom.homepage.web.Homepage, id = 0, render count = 1]: type = ALL
> 3. When I click on AjaxLink 'DISCUSSIONS' (that will update the filter) it still prints:
> Writing [Page class = com.bnpp.ecom.homepage.web.Homepage, id = 0, render count = 1]: type = DISCUSSIONS
> 4. When I refresh the page (F5) the pageid is updated:
> Writing [Page class = com.bnpp.ecom.homepage.web.Homepage, id = 1, render count = 2]: type = DISCUSSIONS
> The url however does not change, it stays http://.../?0
> 5. When I click on AjaxLink 'ALL' (that will update the filter) it prints:
> Writing [Page class = com.bnpp.ecom.homepage.web.Homepage, id = 1, render count = 1]: type = ALL
> So far so good but
> 6. When I refresh the page now (F5) this is printed out:
> Reading [Page class = com.bnpp.ecom.homepage.web.Homepage, id = 0, render count = 1]: type = DISCUSSIONS
> Writing [Page class = com.bnpp.ecom.homepage.web.Homepage, id = 2, render count = 2]: type = DISCUSSIONS
> So it deserializes the page with id 0 although the last known page id was 1 and all changes that were done for version 1 are ignored (in this case switching the type from DISCUSSIONS to ALL).

--
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