You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Илья Нарыжный <ph...@ydn.ru> on 2016/03/26 05:28:04 UTC

Resources can't object HTTP request body

It seems that Wicket Resource can't 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 a Resource object.

Is there any chances to allow Resources to get request body?

Thanks,

Ilia

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: Resources can't object HTTP request body

Posted by Илья Нарыжный <ph...@ydn.ru>.
Martin,

Ticket has been created: https://issues.apache.org/jira/browse/WICKET-6135
Will attach quick start today/tomorrow.

Thanks,

Ilia

2016-03-29 6:39 GMT-07:00 Martin Grigorov <mg...@apache.org>:
> Please create a ticket at JIRA.
> With a quickstart would be nice!
> Thank you!
>
> Martin Grigorov
> Wicket Training and Consulting
> https://twitter.com/mtgrigorov
>
> On Tue, Mar 29, 2016 at 3:30 PM, Илья Нарыжный <ph...@ydn.ru> wrote:
>
>> Martin,
>>
>> There are 3 problems:
>>
>> 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
>>
>> Is it really required for isAjax() method check POST parameters as
>> well? I mean, may be flag is in query string and there is even no goal
>> to check POST body.
>>
>> Thanks,
>>
>> Ilia
>>
>> 2016-03-27 4:07 GMT-07:00 Martin Grigorov <mg...@apache.org>:
>> > Hi,
>> >
>> > I remember dealing with this in the past but I cannot find the mail
>> thread
>> > now.
>> > I think the complete body should be available as a valueless key in the
>> > post parameters:
>> > getRequest().getPostParameters().getParameterNames().iterator().next().
>> > Please confirm whether this works!
>> > If it does then I think it would be good to add a helper method to
>> simplify
>> > this.
>> >
>> > Martin Grigorov
>> > Wicket Training and Consulting
>> > https://twitter.com/mtgrigorov
>> >
>> > On Sat, Mar 26, 2016 at 5:28 AM, Илья Нарыжный <ph...@ydn.ru> wrote:
>> >
>> >> It seems that Wicket Resource can't 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 a Resource object.
>> >>
>> >> Is there any chances to allow Resources to get request body?
>> >>
>> >> Thanks,
>> >>
>> >> Ilia
>> >>
>> >> ---------------------------------------------------------------------
>> >> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>> >> For additional commands, e-mail: users-help@wicket.apache.org
>> >>
>> >>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>> For additional commands, e-mail: users-help@wicket.apache.org
>>
>>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: Resources can't object HTTP request body

Posted by Martin Grigorov <mg...@apache.org>.
Please create a ticket at JIRA.
With a quickstart would be nice!
Thank you!

Martin Grigorov
Wicket Training and Consulting
https://twitter.com/mtgrigorov

On Tue, Mar 29, 2016 at 3:30 PM, Илья Нарыжный <ph...@ydn.ru> wrote:

> Martin,
>
> There are 3 problems:
>
> 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
>
> Is it really required for isAjax() method check POST parameters as
> well? I mean, may be flag is in query string and there is even no goal
> to check POST body.
>
> Thanks,
>
> Ilia
>
> 2016-03-27 4:07 GMT-07:00 Martin Grigorov <mg...@apache.org>:
> > Hi,
> >
> > I remember dealing with this in the past but I cannot find the mail
> thread
> > now.
> > I think the complete body should be available as a valueless key in the
> > post parameters:
> > getRequest().getPostParameters().getParameterNames().iterator().next().
> > Please confirm whether this works!
> > If it does then I think it would be good to add a helper method to
> simplify
> > this.
> >
> > Martin Grigorov
> > Wicket Training and Consulting
> > https://twitter.com/mtgrigorov
> >
> > On Sat, Mar 26, 2016 at 5:28 AM, Илья Нарыжный <ph...@ydn.ru> wrote:
> >
> >> It seems that Wicket Resource can't 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 a Resource object.
> >>
> >> Is there any chances to allow Resources to get request body?
> >>
> >> Thanks,
> >>
> >> Ilia
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> >> For additional commands, e-mail: users-help@wicket.apache.org
> >>
> >>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>

Re: Resources can't object HTTP request body

Posted by Илья Нарыжный <ph...@ydn.ru>.
Martin,

There are 3 problems:

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

Is it really required for isAjax() method check POST parameters as
well? I mean, may be flag is in query string and there is even no goal
to check POST body.

Thanks,

Ilia

2016-03-27 4:07 GMT-07:00 Martin Grigorov <mg...@apache.org>:
> Hi,
>
> I remember dealing with this in the past but I cannot find the mail thread
> now.
> I think the complete body should be available as a valueless key in the
> post parameters:
> getRequest().getPostParameters().getParameterNames().iterator().next().
> Please confirm whether this works!
> If it does then I think it would be good to add a helper method to simplify
> this.
>
> Martin Grigorov
> Wicket Training and Consulting
> https://twitter.com/mtgrigorov
>
> On Sat, Mar 26, 2016 at 5:28 AM, Илья Нарыжный <ph...@ydn.ru> wrote:
>
>> It seems that Wicket Resource can't 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 a Resource object.
>>
>> Is there any chances to allow Resources to get request body?
>>
>> Thanks,
>>
>> Ilia
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>> For additional commands, e-mail: users-help@wicket.apache.org
>>
>>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: Resources can't object HTTP request body

Posted by Martin Grigorov <mg...@apache.org>.
Hi,

I remember dealing with this in the past but I cannot find the mail thread
now.
I think the complete body should be available as a valueless key in the
post parameters:
getRequest().getPostParameters().getParameterNames().iterator().next().
Please confirm whether this works!
If it does then I think it would be good to add a helper method to simplify
this.

Martin Grigorov
Wicket Training and Consulting
https://twitter.com/mtgrigorov

On Sat, Mar 26, 2016 at 5:28 AM, Илья Нарыжный <ph...@ydn.ru> wrote:

> It seems that Wicket Resource can't 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 a Resource object.
>
> Is there any chances to allow Resources to get request body?
>
> Thanks,
>
> Ilia
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>