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

          Christoph Leiter created issue -
          Martin Grigorov made changes -
          Field Original Value New Value
          Assignee Martin Grigorov [ mgrigorov ]
          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.
          Martin Grigorov made changes -
          Status Open [ 1 ] Resolved [ 5 ]
          Fix Version/s 6.7.0 [ 12323964 ]
          Resolution Fixed [ 1 ]
          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.
          Martin Grigorov made changes -
          Resolution Fixed [ 1 ]
          Status Resolved [ 5 ] Reopened [ 4 ]
          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
          Martin Grigorov made changes -
          Remote Link This issue links to "Mail discussion (Web Link)" [ 12072 ]
          Martin Grigorov made changes -
          Fix Version/s 6.8.0 [ 12324068 ]
          Fix Version/s 6.7.0 [ 12323964 ]
          Martin Grigorov made changes -
          Status Reopened [ 4 ] Resolved [ 5 ]
          Resolution Fixed [ 1 ]
          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!
          Transition Time In Source Status Execution Times Last Executer Last Execution Date
          Open Open Resolved Resolved
          4d 19h 10m 1 Martin Grigorov 12/Mar/13 10:48
          Resolved Resolved Reopened Reopened
          1h 56m 1 Martin Grigorov 12/Mar/13 12:44
          Reopened Reopened Resolved Resolved
          37d 20h 8m 1 Martin Grigorov 19/Apr/13 09:53

            People

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

              Dates

              • Created:
                Updated:
                Resolved:

                Development