Wicket
  1. Wicket
  2. WICKET-4116

Ajax link reports weird error when session is expired

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.5.1
    • Fix Version/s: 1.5.2
    • Component/s: wicket
    • Labels:
      None

      Description

      Reproducing steps:

      1. Put below simple page into a Wicket application and get it mounted:

      TestPage.java:

      import org.apache.wicket.ajax.AjaxRequestTarget;
      import org.apache.wicket.ajax.markup.html.AjaxLink;
      import org.apache.wicket.markup.html.WebPage;

      @SuppressWarnings("serial")
      public class TestPage extends WebPage {

      public TestPage() {

      add(new AjaxLink<Void>("test") {

      @Override
      public void onClick(AjaxRequestTarget target) {
      }

      });

      }

      }

      TestPage.html:

      <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
      <?xml version="1.0" encoding="UTF-8"?>
      <html xmlns="http://www.w3.org/1999/xhtml">
      <head>
      <title>Test Page</title>
      </head>
      <body>
      <a wicket:id="test">test</a>
      </body>
      </html>

      2. Access the page in browser via mounted url, the page will display a link.

      3. Wait until current session is expired (do not refresh the page or click the link while waiting).

      4. Hit the link and below exception will be thrown:
      Message: Cannot find behavior with id: 0 on component: [ [Component id = test]]. Perhaps the behavior did not properly implement getStatelessHint() and returned 'true' to indicate that it is stateless instead of returning 'false' to indicate that it is stateful.

      5. In wicket 1.5.0, this results in a PageExpiredException which is more comprehensive.

        Issue Links

          Activity

            People

            • Assignee:
              Martin Grigorov
              Reporter:
              Robin Shine
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development