Uploaded image for project: 'Wicket'
  1. Wicket
  2. WICKET-2675

CryptedUrlWebRequestCodingStrategy fails in form with method="get"

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • 1.4.5
    • 1.4.6
    • None
    • None

    Description

      A form fails to submit when it has method="get" set in a wicket application which is using CryptedUrlWebRequestCodingStrategy.

      This happens because the form is constructed by wicket like this:

      <form wicket:id="form2" method="get" id="form26" action="">
      <div style="display:none">
      <input type="hidden" name="form26_hf_0" id="form26_hf_0" />
      <input type="hidden" name="x" value="vcH4-yiA7z1xdg19IZiML85IPOzB2CaoynoU6UPAVS9n2G2S2bamuw" />
      </div>
      <input type="text" wicket:id="text2" value="" name="text2"/>
      <input type="submit"/>
      </form>

      which can produce a query string in firefox like this:
      http://localhost:8080/crypt-bug/?form26_hf_0=&x=YhsA9niKQasfMz8FBHuRP1lLAZXPdZy8s1XWlmYcu7WwhnsP*VusYw&text2=test

      "x" is the second parameter in the query string, but CryptedUrlWebRequestCodingStrategy accesses this parameter as "?x=" where in this case it is "&x="

      I am attaching the example quickstart app and a possible fix.

      Attachments

        1. crypt-bug.patch
          0.9 kB
          Scott MacKenzie
        2. crypt-bug.zip
          8 kB
          Scott MacKenzie

        Issue Links

          Activity

            People

              ivaynberg Igor Vaynberg
              smackie Scott MacKenzie
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: