You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by "Ilia Naryzhny (JIRA)" <ji...@apache.org> on 2016/04/01 02:08:25 UTC

[jira] [Created] (WICKET-6135) There is no good way to get POST body content

Ilia Naryzhny created WICKET-6135:
-------------------------------------

             Summary: There is no good way to get POST body content
                 Key: WICKET-6135
                 URL: https://issues.apache.org/jira/browse/WICKET-6135
             Project: Wicket
          Issue Type: Bug
          Components: wicket
    Affects Versions: 7.2.0
            Reporter: Ilia Naryzhny


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.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)