Wicket
  1. Wicket
  2. WICKET-5036

Post Parameters are lost when continueToOriginalDestination() is called

    Details

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

      Description

      if a RestartResponseAtInterceptPageException() is thrown during a POST request, the InterceptData.set() method is saving off the parameters, but the call to continueToOriginalDestination() doesn't read these parameters and they get lost on the subsequent call (see lines 173-174 of RestartResponseAtInterceptPageException).

      I will attach a quickstart demoing this. In the quickstart, I would expect the call to continueToOriginalDestination() on the EulaPage to call into the authenticate() on the session and now they should be authenticated, but that call never happens. Instead, it goes back to the SignInPage.

        Issue Links

          Activity

          Hide
          Steve Lowery added a comment -

          Quickstart demoing the bug

          Show
          Steve Lowery added a comment - Quickstart demoing the bug
          Hide
          Sven Meier added a comment -

          My commit is to blame for this one:

          wicket-core/src/main/java/org/apache/wicket/RestartResponseAtInterceptPageException.java
          diff --git a/wicket-core/src/main/java/org/apache/wicket/RestartResponseAtInterceptPageException.java b/wicket-core/src/main/java/org/apache/wicket/RestartResponseAtInterceptPageException.java
          index cdfa766..def29ba 100644
          — a/wicket-core/src/main/java/org/apache/wicket/RestartResponseAtInterceptPageException.java
          +++ b/wicket-core/src/main/java/org/apache/wicket/RestartResponseAtInterceptPageException.java
          @@ -143,7 +143,11 @@

          public static InterceptData get()
          {

          • return Session.get().getMetaData(key);
            + if (Session.exists())
            + { + return Session.get().getMetaData(key); + }

            + return null;
            }

          public static void clear()

          I've create WICKET-5040 to find a solution to this issue.

          Show
          Sven Meier added a comment - My commit is to blame for this one: wicket-core/src/main/java/org/apache/wicket/RestartResponseAtInterceptPageException.java diff --git a/wicket-core/src/main/java/org/apache/wicket/RestartResponseAtInterceptPageException.java b/wicket-core/src/main/java/org/apache/wicket/RestartResponseAtInterceptPageException.java index cdfa766..def29ba 100644 — a/wicket-core/src/main/java/org/apache/wicket/RestartResponseAtInterceptPageException.java +++ b/wicket-core/src/main/java/org/apache/wicket/RestartResponseAtInterceptPageException.java @@ -143,7 +143,11 @@ public static InterceptData get() { return Session.get().getMetaData(key); + if (Session.exists()) + { + return Session.get().getMetaData(key); + } + return null; } public static void clear() I've create WICKET-5040 to find a solution to this issue.
          Hide
          Sven Meier added a comment -
          Show
          Sven Meier added a comment - see WICKET-5040
          Hide
          Sven Meier added a comment -

          BTW SignInForm#onMethodMismatch() (inherited from StatelessForm) returns ABORT, so you'll probably have to override this or otherwise the continued post parameters will not be accepted as a submit.

          Show
          Sven Meier added a comment - BTW SignInForm#onMethodMismatch() (inherited from StatelessForm) returns ABORT, so you'll probably have to override this or otherwise the continued post parameters will not be accepted as a submit.

            People

            • Assignee:
              Sven Meier
              Reporter:
              Steve Lowery
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development