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

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

     [ https://issues.apache.org/jira/browse/WICKET-6135?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Martin Grigorov resolved WICKET-6135.
-------------------------------------
       Resolution: Fixed
         Assignee: Martin Grigorov
    Fix Version/s: 6.23.0
                   8.0.0-M1
                   7.3.0

WebRequest#isAjax() now uses only the GET parameters.

> 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
>            Assignee: Martin Grigorov
>             Fix For: 7.3.0, 8.0.0-M1, 6.23.0
>
>
> 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)