Wicket
  1. Wicket
  2. WICKET-4400

form parameters which should be submitted using POST are added to url after first display of feedback messages

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Blocker Blocker
    • Resolution: Fixed
    • Affects Version/s: 6.0.0-beta1
    • Fix Version/s: None
    • Component/s: wicket
    • Environment:
      6.0 trunk, OS X, Chrome

      Description

      this bug is really weird...

      quickest way to reproduce is do the following:

      $> cd /wicket/wicket-examples
      $> mvn jetty:run

      • click the 'forminput - Basic form processing.' example
      • click 'save'

      (notice that there will be a feedback message displayed below)

      • click 'save' again

      the url will look like this:
      http://localhost:8080/forminput/?4&doubleProperty=20.5&idc_hf_0&integerProperty=100&saveButton=save&stringProperty=test&localeSelect=0&multiply:right=0&lines:1:lineEdit=line+two&multiply:left=0&lines:2:lineEdit=line+three&numberRadioChoice=0&lines:0:lineEdit=line+one&urlProperty=http://wicket.apache.org&integerInRangeProperty=50&phoneNumberUS=%28123%29+456-1234

      Obviously the result from getting the POST parameters being added to the url

      I also did a small quickstart example with a similar result...

      My current summary is:

      Once a feedback message is displayed the url will look get spoiled on the subsequent request.

      I consider this a blocker as this should actually crash all apps urls that use a form and feedback messages and there's no obvious workaround...

        Activity

        Igor Vaynberg made changes -
        Status Open [ 1 ] Resolved [ 5 ]
        Resolution Fixed [ 1 ]
        Emond Papegaaij made changes -
        Assignee Igor Vaynberg [ ivaynberg ]
        Hide
        Emond Papegaaij added a comment -

        I've found the real cause of the problem: the cleanup of the feedbackmessages (called during detach) increments the page version. This causes the page to be stored under a version that does not correspond to the versions in the urls rendered on the page. Any url clicked or behavior triggered will cause a page expiry, after which the page is reconstructed and the form parameters are added as page parameters.

        Commenting out addStateChange() in Component.detachFeedback() (line 1204) fixes the problem.

        Show
        Emond Papegaaij added a comment - I've found the real cause of the problem: the cleanup of the feedbackmessages (called during detach) increments the page version. This causes the page to be stored under a version that does not correspond to the versions in the urls rendered on the page. Any url clicked or behavior triggered will cause a page expiry, after which the page is reconstructed and the form parameters are added as page parameters. Commenting out addStateChange() in Component.detachFeedback() (line 1204) fixes the problem.
        Hide
        Martin Grigorov added a comment -

        I'm not sure why git bisect says that FeedbackMessages change is the cause.
        The real cause is WICKET-4338 which reads POST params and puts them in Page's PageParameters. Later when WebPageRenderer creates the targetUrl it uses them and puts them in the created URL.
        Maybe PageParameters should be extended to keep a separate structure for POST params which should be ignored for Url generation.

        Show
        Martin Grigorov added a comment - I'm not sure why git bisect says that FeedbackMessages change is the cause. The real cause is WICKET-4338 which reads POST params and puts them in Page's PageParameters. Later when WebPageRenderer creates the targetUrl it uses them and puts them in the created URL. Maybe PageParameters should be extended to keep a separate structure for POST params which should be ignored for Url generation.
        Peter Ertl made changes -
        Comment [ I know about that commit since I committed it :-)

        Unfortunately it just makes the effect visible since feedback panel did not show any messages before that (except the messages related to the panel itself which is usually never). The real problem is buries somewhere deeper... ]
        Hide
        Emond Papegaaij added a comment -

        The commit that broke this is:
        76e1663d0b73f605dc55f519a92b474eab237538 WICKET-499 WICKET-2705 feedback storage refactoring.

        The problem seems to be even worse. In our app, we always display a feedback message on our login page, and this is causing the login page to not work at all. I can't login anymore and the username and password are shown in the url after pressing 'login'.

        Show
        Emond Papegaaij added a comment - The commit that broke this is: 76e1663d0b73f605dc55f519a92b474eab237538 WICKET-499 WICKET-2705 feedback storage refactoring. The problem seems to be even worse. In our app, we always display a feedback message on our login page, and this is causing the login page to not work at all. I can't login anymore and the username and password are shown in the url after pressing 'login'.
        Peter Ertl made changes -
        Description this bug is _really_ weird...

        quickest way to reproduce is do the following:

        $> cd /wicket/wicket-examples
        $> mvn jetty:run

        - click the 'forminput - Basic form processing.' example

        - click 'save'

        (notice that there will be a feedback message displayed below)

        - click 'save' again

        the url will look like this:
        http://localhost:8080/forminput/?4&doubleProperty=20.5&idc_hf_0&integerProperty=100&saveButton=save&stringProperty=test&localeSelect=0&multiply:right=0&lines:1:lineEdit=line+two&multiply:left=0&lines:2:lineEdit=line+three&numberRadioChoice=0&lines:0:lineEdit=line+one&urlProperty=http://wicket.apache.org&integerInRangeProperty=50&phoneNumberUS=%28123%29+456-1234

        Obviously the result from getting the POST parameters being added to the url

        I also did a small quickstart example with a similar result...

        My current summary is:

        Once a feedback message is displayed the url will look get spoiled on the subsequent request.

        I consider this a bug since the form parameters should be submitted using POST, not GET.

        I consider this a blocker as this should actually crash all apps that use a form and feedback messages and there's no obvious workaround...
        this bug is _really_ weird...

        quickest way to reproduce is do the following:

        $> cd /wicket/wicket-examples
        $> mvn jetty:run

        - click the 'forminput - Basic form processing.' example

        - click 'save'

        (notice that there will be a feedback message displayed below)

        - click 'save' again

        the url will look like this:
        http://localhost:8080/forminput/?4&doubleProperty=20.5&idc_hf_0&integerProperty=100&saveButton=save&stringProperty=test&localeSelect=0&multiply:right=0&lines:1:lineEdit=line+two&multiply:left=0&lines:2:lineEdit=line+three&numberRadioChoice=0&lines:0:lineEdit=line+one&urlProperty=http://wicket.apache.org&integerInRangeProperty=50&phoneNumberUS=%28123%29+456-1234

        Obviously the result from getting the POST parameters being added to the url

        I also did a small quickstart example with a similar result...

        My current summary is:

        Once a feedback message is displayed the url will look get spoiled on the subsequent request.

        I consider this a blocker as this should actually crash all apps urls that use a form and feedback messages and there's no obvious workaround...
        Peter Ertl made changes -
        Field Original Value New Value
        Description this bug is _really_ weird...

        quickest way to reproduce is do the following:

        $> cd /wicket/wicket-examples
        $> mvn jetty:run

        - click the 'forminput - Basic form processing.' example

        - click 'save'

        (notice that there will be a feedback message displayed below)

        - click 'save' again

        the url will look like this:
        http://localhost:8080/forminput/?4&doubleProperty=20.5&idc_hf_0&integerProperty=100&saveButton=save&stringProperty=test&localeSelect=0&multiply:right=0&lines:1:lineEdit=line+two&multiply:left=0&lines:2:lineEdit=line+three&numberRadioChoice=0&lines:0:lineEdit=line+one&urlProperty=http://wicket.apache.org&integerInRangeProperty=50&phoneNumberUS=%28123%29+456-1234

        Obviously the result from getting the POST parameters being added to the url

        I also did a small sample with the same result...

        My current summary is:

        Once a feedback message is displayed the url will look get spoiled on the subsequent request.

        I consider this a bug since the form parameters should be submitted using POST, not GET.

        I consider this a blocker as this should actually crash all apps that use a form and feedback messages and there's no obvious workaround...
        this bug is _really_ weird...

        quickest way to reproduce is do the following:

        $> cd /wicket/wicket-examples
        $> mvn jetty:run

        - click the 'forminput - Basic form processing.' example

        - click 'save'

        (notice that there will be a feedback message displayed below)

        - click 'save' again

        the url will look like this:
        http://localhost:8080/forminput/?4&doubleProperty=20.5&idc_hf_0&integerProperty=100&saveButton=save&stringProperty=test&localeSelect=0&multiply:right=0&lines:1:lineEdit=line+two&multiply:left=0&lines:2:lineEdit=line+three&numberRadioChoice=0&lines:0:lineEdit=line+one&urlProperty=http://wicket.apache.org&integerInRangeProperty=50&phoneNumberUS=%28123%29+456-1234

        Obviously the result from getting the POST parameters being added to the url

        I also did a small quickstart example with a similar result...

        My current summary is:

        Once a feedback message is displayed the url will look get spoiled on the subsequent request.

        I consider this a bug since the form parameters should be submitted using POST, not GET.

        I consider this a blocker as this should actually crash all apps that use a form and feedback messages and there's no obvious workaround...
        Peter Ertl created issue -

          People

          • Assignee:
            Igor Vaynberg
            Reporter:
            Peter Ertl
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development