• Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Won't Fix
    • Affects Version/s: 1.2.2, 1.2.3, 1.2.6
    • Fix Version/s: 1.2.7
    • Component/s: wicket
    • Labels:


      We are still getting page expired using wicket with ajax. The problem is related to the PageMap and occurs as following:

      1. We have a page with an ajax time behavior that updates a status every 2 sec. This page is the most top one on the page map stack.
      2. On this page you click the link to go to another page. The new page is added to the page stack but the response is expensive, let's say it take 1-2 sec. to build the page.
      3. During the response is processed, the browser triggers the ajax request, to the server. The request goes to the PageMap to get the current page.
      The page of the ajax request is the second top one on the stack, so the current code assumes the user clicked the back button and removes the
      top one page.
      4. In the browser everything seams to be ok, but the page in the browser and in the PageMap don't match anymore. So any new request to the server will cause page expired.

      This is very simple to reproduce, following is a snippet for the quickstart:

      — —
      public class Index extends QuickStartPage

      public Index(final PageParameters parameters)
      // link to the same page
      Link link = new Link("link")
      public void onClick()

      { setResponsePage(Index.class); }


      // we just need a delayed call to the server
      AjaxEventBehavior behavrior = new AjaxEventBehavior("onClick")
      protected void onEvent(AjaxRequestTarget target)


      protected void onAfterRender()
      // simulate expensive response

      { Thread.sleep(500); }

      catch (InterruptedException e)

      { e.printStackTrace(); }



      — Index.html —
      <a wicket:id="link">Click</a>

      I used Firefox only to reproduce it, not sure if this occurs with other browser as well.

      We have a small workaround('fix') for it. In DefaultRequestTargetResolverStrategy we check the type of the request. If it is a IUnversionedBehaviorListener, we don't update the PageMap in the access() method. It is not a clean solution but it works so far.




            • Assignee:
              jcompagner Johan Compagner
              smitti Adam Smyczek
            • Votes:
              0 Vote for this issue
              0 Start watching this issue


              • Created: