Uploaded image for project: 'Wicket'
  1. Wicket
  2. WICKET-4360

Wicket reloading old page id on page refresh

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Not A Problem
    • 1.5.3
    • None
    • wicket
    • None
    • Windows & linux, jetty 7 & WAS 7

    Description

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

      Attachments

        1. wicket4360.zip
          8 kB
          Stijn Geukens

        Issue Links

          Activity

            People

              Unassigned Unassigned
              thestijn Stijn Geukens
              Votes:
              2 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: