Wicket
  1. Wicket
  2. WICKET-5083

Page#isPageStateless() may return wrong value

    Details

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

      Description

      This ticket is a follow up to WICKET-5078 (WICKET-4763 also seems related).

      Page#isPageStateless() can be invoked at a time where onInitialize() hasn't been called yet. This causes pages to report that they are not stateful, even though they are, if the stateful components are added in onInitialize() and not in the constructor.

        Issue Links

          Activity

          Hide
          Martin Grigorov added a comment -

          From now on the page (and all components inside) will be initialized if they are not already.
          The initialization will happen as late as possible. I.e. after the light checks - isBookmarkable and stateless hint.

          Show
          Martin Grigorov added a comment - From now on the page (and all components inside) will be initialized if they are not already. The initialization will happen as late as possible. I.e. after the light checks - isBookmarkable and stateless hint.
          Hide
          Martin Grigorov added a comment -

          The commit has been reverted because it lead to executing #onInitialize() in the constructor of a page.

          Show
          Martin Grigorov added a comment - The commit has been reverted because it lead to executing #onInitialize() in the constructor of a page.
          Hide
          Martin Grigorov added a comment -

          Once 6.8.0-SNAPSHOT is available I'll re-apply beee594d98f82d1bf8b59c3c69dbe33eb1743091 +
          — i/wicket-core/src/main/java/org/apache/wicket/page/AbstractPageManager.java
          +++ w/wicket-core/src/main/java/org/apache/wicket/page/AbstractPageManager.java
          @@ -127,10 +127,6 @@ public abstract class AbstractPageManager implements IPageManager
          @Override
          public void touchPage(IManageablePage page)
          {

          • if (!page.isPageStateless())
          • { - getContext().bind(); - }

            getRequestAdapter().touch(page);

          and test it more extensively before 6.8.0

          Show
          Martin Grigorov added a comment - Once 6.8.0-SNAPSHOT is available I'll re-apply beee594d98f82d1bf8b59c3c69dbe33eb1743091 + — i/wicket-core/src/main/java/org/apache/wicket/page/AbstractPageManager.java +++ w/wicket-core/src/main/java/org/apache/wicket/page/AbstractPageManager.java @@ -127,10 +127,6 @@ public abstract class AbstractPageManager implements IPageManager @Override public void touchPage(IManageablePage page) { if (!page.isPageStateless()) { - getContext().bind(); - } getRequestAdapter().touch(page); and test it more extensively before 6.8.0
          Hide
          Sven Meier added a comment -

          Hi Martin,

          will you revert the revert (af890025eb8fd12459600cf2cf93bc78661589f4) too?

          diff --git a/wicket-core/src/main/java/org/apache/wicket/Page.java b/wicket-core/src/main/java/org/apache/wicket/Page.java
          index 86c0472..1467798 100644
          — a/wicket-core/src/main/java/org/apache/wicket/Page.java
          +++ b/wicket-core/src/main/java/org/apache/wicket/Page.java
          @@ -450,8 +450,6 @@

          if (stateless == null)
          {

          • internalInitialize();
            -
            if (isStateless() == false)
            {
            stateless = Boolean.FALSE;
          Show
          Sven Meier added a comment - Hi Martin, will you revert the revert (af890025eb8fd12459600cf2cf93bc78661589f4) too? diff --git a/wicket-core/src/main/java/org/apache/wicket/Page.java b/wicket-core/src/main/java/org/apache/wicket/Page.java index 86c0472..1467798 100644 — a/wicket-core/src/main/java/org/apache/wicket/Page.java +++ b/wicket-core/src/main/java/org/apache/wicket/Page.java @@ -450,8 +450,6 @@ if (stateless == null) { internalInitialize(); - if (isStateless() == false) { stateless = Boolean.FALSE;
          Hide
          Martin Grigorov added a comment -

          Thanks, Sven!

          Show
          Martin Grigorov added a comment - Thanks, Sven!

            People

            • Assignee:
              Martin Grigorov
              Reporter:
              Christoph Leiter
            • Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development