Tapestry 5
  1. Tapestry 5
  2. TAP5-2084

Form should decode its link parameters

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 5.3
    • Fix Version/s: 5.3.7, 5.4
    • Component/s: None
    • Labels:
      None

      Description

      The Form component will add all its action event link parameters as hidden inputs, but link parameter's value is encoded and hidden input field value is not, because of that parameter's value will be encoded on arrival.

      simple request:
      //add parameter to the link
      link.addParameter ("abc", URLDecoder.encode(abcValue, "UTF-8"))
      on event:
      request.getParameter("abc") is equals to abcValue

      form request:
      // add parameter to the form action link using the LinkCreationHub
      link.addParameter ("abc", URLDecoder.encode(value, "UTF-8"))
      on event:
      request.getParameter("abc") is not equals to abcValue, parameter's value is encoded

      It could be fixed by decoding parameter's value at line:

      writer.element("input", "type", "hidden", "name", parameterName, "value", value);

        Activity

        Hide
        Denis Stepanov added a comment -

        Git patch with tests

        Show
        Denis Stepanov added a comment - Git patch with tests
        Hide
        Kalle Korhonen added a comment -

        Applied cleanly, thanks Denis!

        Show
        Kalle Korhonen added a comment - Applied cleanly, thanks Denis!
        Hide
        Hudson added a comment -

        Integrated in tapestry-trunk-freestyle #1044 (See https://builds.apache.org/job/tapestry-trunk-freestyle/1044/)
        FIXED - TAP5-2084: Form should decode its link parameters (Revision 1f89691bf21acd9cde8bccb3e8fc153b76605fab)

        Result = FAILURE
        kaosko :
        Files :

        • tapestry-core/src/test/resources/org/apache/tapestry5/integration/app1/pages/FormLinkParameters.tml
        • tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/pages/Index.java
        • tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/pages/FormLinkParameters.java
        • tapestry-core/src/main/java/org/apache/tapestry5/corelib/components/Form.java
        • tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/FormTests.java
        Show
        Hudson added a comment - Integrated in tapestry-trunk-freestyle #1044 (See https://builds.apache.org/job/tapestry-trunk-freestyle/1044/ ) FIXED - TAP5-2084 : Form should decode its link parameters (Revision 1f89691bf21acd9cde8bccb3e8fc153b76605fab) Result = FAILURE kaosko : Files : tapestry-core/src/test/resources/org/apache/tapestry5/integration/app1/pages/FormLinkParameters.tml tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/pages/Index.java tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/pages/FormLinkParameters.java tapestry-core/src/main/java/org/apache/tapestry5/corelib/components/Form.java tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/FormTests.java
        Hide
        Denis Stepanov added a comment -

        Thanks! Is there any way it could make into the 5.3.7?

        Show
        Denis Stepanov added a comment - Thanks! Is there any way it could make into the 5.3.7?
        Hide
        Kalle Korhonen added a comment -

        See Fix Versions field.

        Show
        Kalle Korhonen added a comment - See Fix Versions field.

          People

          • Assignee:
            Kalle Korhonen
            Reporter:
            Denis Stepanov
          • Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development