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

There is no good way to get POST body content

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 7.2.0
    • Fix Version/s: 7.3.0, 8.0.0-M1, 6.23.0
    • Component/s: wicket
    • Labels:
      None

      Description

      There is no way to obtain whole HTTP POST body.
      The reason of that is the following:
      Mappers invoke WebRequest.isAjax() and isAjax() is trying to
      getRequestParameters() - so body of POST parsed prior to actual
      getInputStream() in code.

      There is bad workaround: to collect body through something like getRequest().getPostParameters().getParameterNames().iterator().next().

      But it's really bad because of the following reasons:

      1) Map can not guarantee that order of keys remain the same. In my
      case Jetty use HashMap as underling storage.
      2) Some part of content might be URL encoded. So after collecting all
      back: it's hard to revert exectly to initial value due to fact that
      some parts contained URL encoded stuff.
      3) POST can contain huge body. So it looks very strange.

      As a work-around I use Filter configured prior to wicket to intercept
      body whenever it's needed:
      https://github.com/OrienteerDW/wicket-orientdb/commit/c9e706d9e84a828901a5ad97ed50aa46521f7bfb

      Please find a good way to get required stuff in wicket.

        Attachments

          Activity

            People

            • Assignee:
              mgrigorov Martin Grigorov
              Reporter:
              phantom Ilia Naryzhny
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: