You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Tobias Soloschenko <to...@googlemail.com> on 2014/09/15 14:11:36 UTC

Ajax Post Data

Hi,

is there a way to process post data with the wicket ajax function - ep dep are only for strings.

Kind regards and thanks! 

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


Re: Ajax Post Data

Posted by Ernesto Reinaldo Barreiro <re...@gmail.com>.
Hi,

You dont need to change your API: panel will remain the same.

On Tue, Sep 16, 2014 at 8:44 AM, Tobias Soloschenko <
tobiassoloschenko@googlemail.com> wrote:

> Hi,
>
> I will have a look at it, but I don't want the API to be changed. Thanks
> anyway for the Feedback.
>
> kind regards
>
> Tobias
>
> > Am 15.09.2014 um 21:32 schrieb Ernesto Reinaldo Barreiro <
> reiern70@gmail.com>:
> >
> > You can make it abstract with same callback methods as panel. Users can
> the
> > choose between panel or behavior.
> >
> > On Mon, Sep 15, 2014 at 8:41 PM, Tobias Soloschenko <
> > tobiassoloschenko@googlemail.com> wrote:
> >
> >> Hi,
> >>
> >> it is not public static because of the use of ids and because of the
> >> callback methods.
> >>
> >> kind regards
> >>
> >> Tobias
> >>
> >> 2014-09-15 20:37 GMT+02:00 Ernesto Reinaldo Barreiro <
> reiern70@gmail.com>:
> >>
> >>> Hi,
> >>>
> >>> Thanks for sharing! Why not make HTML5FilesDropableAjaxEventBehavior
> >> public
> >>> static so that it can be reused independently of Panel?
> >>>
> >>> On Mon, Sep 15, 2014 at 8:30 PM, Tobias Soloschenko <
> >>> tobiassoloschenko@googlemail.com> wrote:
> >>>
> >>>> Ok I solved my problem with the quickstart and some investigations
> >> about
> >>>> post requests:
> >>>>
> >>>>    var reader = new FileReader();
> >>>>    reader.onload = (function(file) {
> >>>>        return function(e) {
> >>>>            Wicket.Ajax.post({'u':'%s&fileName=' + encodeURIComponent(
> >>>> file.name) + '&dropid='+dropid+'&fileid=' + fileid,
> >>>>            ep:{data:btoa(reader.result)}, coh:[function(){
> >>>>                // getFinishedUploadClientScript
> >>>>                %s;
> >>>>            }]});
> >>>>        }
> >>>>    })(file);
> >>>>    reader.readAsBinaryString(file);
> >>>>
> >>>> I add the content of the file as base64 encoded binary string to the
> >>>> variable with the name data. The upload is now working like a charm.
> >> The
> >>>> only thing the developer has to know about is the max of mb (2mb in
> >>> example
> >>>> of tomcat) for post requests:
> >>>>
> >>>> https://github.com/klopfdreh/wicket-components-playground
> >>>>
> >>>> kind regards
> >>>>
> >>>> Tobias
> >>>>
> >>>>
> >>>> 2014-09-15 15:53 GMT+02:00 Martin Grigorov <mg...@apache.org>:
> >>>>
> >>>>> Please file a ticket with attached quickstart application.
> >>>>>
> >>>>> Martin Grigorov
> >>>>> Wicket Training and Consulting
> >>>>> https://twitter.com/mtgrigorov
> >>>>>
> >>>>> On Mon, Sep 15, 2014 at 4:44 PM, Tobias Soloschenko <
> >>>>> tobiassoloschenko@googlemail.com> wrote:
> >>>>>
> >>>>>> Let me show an example (%s are going to be replaced with the url /
> >>>>>> callbackscript):
> >>>>>>
> >>>>>>    $.ajax({
> >>>>>>        type : 'POST',
> >>>>>>        url : '%s&fileName=' + encodeURIComponent(file.name) +
> >>>>>> '&dropid='+dropid+'&fileid=' + fileid,
> >>>>>>        data : file,
> >>>>>>        contentType : false,
> >>>>>>        processData : false,
> >>>>>>
> >>>>>>        success:function(data, textStatus, jqXHR){
> >>>>>>            var file = this.data
> >>>>>>            // getFinishedUploadClientScript
> >>>>>>            %s
> >>>>>>        }
> >>>>>>    });
> >>>>>>
> >>>>>> With this code I can invoke this on server side and read the data:
> >>>>>> ((HttpServletRequest)
> >>> RequestCycle.get().getRequest().getContainerRequest()).getInputStream()
> >>>>>>
> >>>>>> ---
> >>>>>>
> >>>>>>    Wicket.Ajax.post({'u':'%s&fileName=' + encodeURIComponent(
> >>>> file.name)
> >>>>> +
> >>>>>> '&dropid='+dropid+'&fileid=' + fileid, ep:file,sh:function(){
> >>>>>>        // getFinishedUploadClientScript
> >>>>>>        %s;
> >>>>>>    }});
> >>>>>>
> >>>>>> This code is not working with the server side handling of the post
> >>>>> content
> >>>>>>
> >>>>>> kind regards
> >>>>>>
> >>>>>> Tobias
> >>>>>>
> >>>>>>
> >>>>>>
> >>>>>>
> >>>>>> 2014-09-15 15:38 GMT+02:00 Tobias Soloschenko <
> >>>>>> tobiassoloschenko@googlemail.com>:
> >>>>>>
> >>>>>>> No - I'm using Wicket.Ajax.post(...) - but if I do a normal
> >> $.ajax
> >>>> with
> >>>>>> --
> >>>>>>> type:post, contentType:false, processData:false --I can read the
> >>>>> content
> >>>>>> by
> >>>>>>> inputstream I saw that the attrs.ep are passed into the data
> >>> property
> >>>>> but
> >>>>>>> they are encoded which is wrong jQuery.param(data) line 634 of
> >>>>>>> wicket-ajax-jquery. And how can I set the other both options so
> >>> that
> >>>> I
> >>>>>> can
> >>>>>>> read the content via stream?
> >>>>>>>
> >>>>>>> Kind regards
> >>>>>>>
> >>>>>>> Tobias
> >>>>>>>
> >>>>>>>> Am 15.09.2014 um 15:28 schrieb Martin Grigorov <
> >>>> mgrigorov@apache.org
> >>>>>> :
> >>>>>>>>
> >>>>>>>> If you use Wicket.Ajax.post() or Wicket.Ajax.ajax({"m":"post",
> >>>> ....})
> >>>>>>> then
> >>>>>>>> the parameters won't be in the query string.
> >>>>>>>>
> >>>>>>>> wicket-ajax.js puts the parameters to $.ajax({data: HERE, ...})
> >>> and
> >>>>>>>> depending on the used 'method' (GET or POST) they will be in
> >> the
> >>>>> query
> >>>>>>>> string or request body.
> >>>>>>>>
> >>>>>>>> Do you say that with method=post you still see the parameter in
> >>> the
> >>>>>> query
> >>>>>>>> string ?
> >>>>>>>>
> >>>>>>>> Martin Grigorov
> >>>>>>>> Wicket Training and Consulting
> >>>>>>>> https://twitter.com/mtgrigorov
> >>>>>>>>
> >>>>>>>> On Mon, Sep 15, 2014 at 4:24 PM, Tobias Soloschenko <
> >>>>>>>> tobiassoloschenko@googlemail.com> wrote:
> >>>>>>>>
> >>>>>>>>> But they are add to the query string. This is really bad -
> >> maybe
> >>>> it
> >>>>>>> would
> >>>>>>>>> be nice to add a new special attribute which is given directly
> >>> to
> >>>>> the
> >>>>>>>>> jquery's data attribute. It would be possible to get the
> >> content
> >>>> via
> >>>>>>>>> inputstream of the httpservletrequest.
> >>
> ((HttpServletRequest)RequestCycle.get().getRequest().getContainerRequest()).getInputStream()
> >>>>>>>>>
> >>>>>>>>> kind regards
> >>>>>>>>>
> >>>>>>>>> Tobias
> >>>>>>>>>
> >>>>>>>>>> Am 15.09.2014 um 14:43 schrieb Martin Grigorov <
> >>>>> mgrigorov@apache.org
> >>>>>>> :
> >>>>>>>>>>
> >>>>>>>>>> With HTTP you can send either string or binary.
> >>>>>>>>>> You have to convert at the server side
> >>>>>>>>>> On Sep 15, 2014 3:20 PM, "Tobias Soloschenko" <
> >>>>>>>>>> tobiassoloschenko@googlemail.com> wrote:
> >>>>>>>>>>
> >>>>>>>>>>> And how do I read the ep / dep in the backend if they aren't
> >>> of
> >>>>> Type
> >>>>>>>>>>> String but a plain javascript object?
> >>>>>>>>>>>
> >>>>>>>>>>> ty for the fast response!
> >>>>>>>>>>>
> >>>>>>>>>>> Tobias
> >>>>>>>>>>>
> >>>>>>>>>>>> Am 15.09.2014 um 14:16 schrieb Martin Grigorov <
> >>>>>> mgrigorov@apache.org
> >>>>>>>> :
> >>>>>>>>>>>>
> >>>>>>>>>>>> http://markmail.org/message/fw7cjfo7bzvkjfdu
> >>>>>>>>>>>>
> >>>>>>>>>>>> Martin Grigorov
> >>>>>>>>>>>> Wicket Training and Consulting
> >>>>>>>>>>>> https://twitter.com/mtgrigorov
> >>>>>>>>>>>>
> >>>>>>>>>>>> On Mon, Sep 15, 2014 at 3:11 PM, Tobias Soloschenko <
> >>>>>>>>>>>> tobiassoloschenko@googlemail.com> wrote:
> >>>>>>>>>>>>
> >>>>>>>>>>>>> Hi,
> >>>>>>>>>>>>>
> >>>>>>>>>>>>> is there a way to process post data with the wicket ajax
> >>>>> function
> >>>>>> -
> >>>>>>> ep
> >>>>>>>>>>> dep
> >>>>>>>>>>>>> are only for strings.
> >>>>>>>>>>>>>
> >>>>>>>>>>>>> Kind regards and thanks!
> >>>>>>>>>>>>>
> >>>>>>>>>>>>> Tobias
> >>> ---------------------------------------------------------------------
> >>>>>>>>>>>>> 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
> >>>
> >>>
> >>>
> >>> --
> >>> Regards - Ernesto Reinaldo Barreiro
> >
> >
> >
> > --
> > Regards - Ernesto Reinaldo Barreiro
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>


-- 
Regards - Ernesto Reinaldo Barreiro

Re: Ajax Post Data

Posted by Tobias Soloschenko <to...@googlemail.com>.
Hi,

I will have a look at it, but I don't want the API to be changed. Thanks anyway for the Feedback.

kind regards

Tobias

> Am 15.09.2014 um 21:32 schrieb Ernesto Reinaldo Barreiro <re...@gmail.com>:
> 
> You can make it abstract with same callback methods as panel. Users can the
> choose between panel or behavior.
> 
> On Mon, Sep 15, 2014 at 8:41 PM, Tobias Soloschenko <
> tobiassoloschenko@googlemail.com> wrote:
> 
>> Hi,
>> 
>> it is not public static because of the use of ids and because of the
>> callback methods.
>> 
>> kind regards
>> 
>> Tobias
>> 
>> 2014-09-15 20:37 GMT+02:00 Ernesto Reinaldo Barreiro <re...@gmail.com>:
>> 
>>> Hi,
>>> 
>>> Thanks for sharing! Why not make HTML5FilesDropableAjaxEventBehavior
>> public
>>> static so that it can be reused independently of Panel?
>>> 
>>> On Mon, Sep 15, 2014 at 8:30 PM, Tobias Soloschenko <
>>> tobiassoloschenko@googlemail.com> wrote:
>>> 
>>>> Ok I solved my problem with the quickstart and some investigations
>> about
>>>> post requests:
>>>> 
>>>>    var reader = new FileReader();
>>>>    reader.onload = (function(file) {
>>>>        return function(e) {
>>>>            Wicket.Ajax.post({'u':'%s&fileName=' + encodeURIComponent(
>>>> file.name) + '&dropid='+dropid+'&fileid=' + fileid,
>>>>            ep:{data:btoa(reader.result)}, coh:[function(){
>>>>                // getFinishedUploadClientScript
>>>>                %s;
>>>>            }]});
>>>>        }
>>>>    })(file);
>>>>    reader.readAsBinaryString(file);
>>>> 
>>>> I add the content of the file as base64 encoded binary string to the
>>>> variable with the name data. The upload is now working like a charm.
>> The
>>>> only thing the developer has to know about is the max of mb (2mb in
>>> example
>>>> of tomcat) for post requests:
>>>> 
>>>> https://github.com/klopfdreh/wicket-components-playground
>>>> 
>>>> kind regards
>>>> 
>>>> Tobias
>>>> 
>>>> 
>>>> 2014-09-15 15:53 GMT+02:00 Martin Grigorov <mg...@apache.org>:
>>>> 
>>>>> Please file a ticket with attached quickstart application.
>>>>> 
>>>>> Martin Grigorov
>>>>> Wicket Training and Consulting
>>>>> https://twitter.com/mtgrigorov
>>>>> 
>>>>> On Mon, Sep 15, 2014 at 4:44 PM, Tobias Soloschenko <
>>>>> tobiassoloschenko@googlemail.com> wrote:
>>>>> 
>>>>>> Let me show an example (%s are going to be replaced with the url /
>>>>>> callbackscript):
>>>>>> 
>>>>>>    $.ajax({
>>>>>>        type : 'POST',
>>>>>>        url : '%s&fileName=' + encodeURIComponent(file.name) +
>>>>>> '&dropid='+dropid+'&fileid=' + fileid,
>>>>>>        data : file,
>>>>>>        contentType : false,
>>>>>>        processData : false,
>>>>>> 
>>>>>>        success:function(data, textStatus, jqXHR){
>>>>>>            var file = this.data
>>>>>>            // getFinishedUploadClientScript
>>>>>>            %s
>>>>>>        }
>>>>>>    });
>>>>>> 
>>>>>> With this code I can invoke this on server side and read the data:
>>>>>> ((HttpServletRequest)
>>> RequestCycle.get().getRequest().getContainerRequest()).getInputStream()
>>>>>> 
>>>>>> ---
>>>>>> 
>>>>>>    Wicket.Ajax.post({'u':'%s&fileName=' + encodeURIComponent(
>>>> file.name)
>>>>> +
>>>>>> '&dropid='+dropid+'&fileid=' + fileid, ep:file,sh:function(){
>>>>>>        // getFinishedUploadClientScript
>>>>>>        %s;
>>>>>>    }});
>>>>>> 
>>>>>> This code is not working with the server side handling of the post
>>>>> content
>>>>>> 
>>>>>> kind regards
>>>>>> 
>>>>>> Tobias
>>>>>> 
>>>>>> 
>>>>>> 
>>>>>> 
>>>>>> 2014-09-15 15:38 GMT+02:00 Tobias Soloschenko <
>>>>>> tobiassoloschenko@googlemail.com>:
>>>>>> 
>>>>>>> No - I'm using Wicket.Ajax.post(...) - but if I do a normal
>> $.ajax
>>>> with
>>>>>> --
>>>>>>> type:post, contentType:false, processData:false --I can read the
>>>>> content
>>>>>> by
>>>>>>> inputstream I saw that the attrs.ep are passed into the data
>>> property
>>>>> but
>>>>>>> they are encoded which is wrong jQuery.param(data) line 634 of
>>>>>>> wicket-ajax-jquery. And how can I set the other both options so
>>> that
>>>> I
>>>>>> can
>>>>>>> read the content via stream?
>>>>>>> 
>>>>>>> Kind regards
>>>>>>> 
>>>>>>> Tobias
>>>>>>> 
>>>>>>>> Am 15.09.2014 um 15:28 schrieb Martin Grigorov <
>>>> mgrigorov@apache.org
>>>>>> :
>>>>>>>> 
>>>>>>>> If you use Wicket.Ajax.post() or Wicket.Ajax.ajax({"m":"post",
>>>> ....})
>>>>>>> then
>>>>>>>> the parameters won't be in the query string.
>>>>>>>> 
>>>>>>>> wicket-ajax.js puts the parameters to $.ajax({data: HERE, ...})
>>> and
>>>>>>>> depending on the used 'method' (GET or POST) they will be in
>> the
>>>>> query
>>>>>>>> string or request body.
>>>>>>>> 
>>>>>>>> Do you say that with method=post you still see the parameter in
>>> the
>>>>>> query
>>>>>>>> string ?
>>>>>>>> 
>>>>>>>> Martin Grigorov
>>>>>>>> Wicket Training and Consulting
>>>>>>>> https://twitter.com/mtgrigorov
>>>>>>>> 
>>>>>>>> On Mon, Sep 15, 2014 at 4:24 PM, Tobias Soloschenko <
>>>>>>>> tobiassoloschenko@googlemail.com> wrote:
>>>>>>>> 
>>>>>>>>> But they are add to the query string. This is really bad -
>> maybe
>>>> it
>>>>>>> would
>>>>>>>>> be nice to add a new special attribute which is given directly
>>> to
>>>>> the
>>>>>>>>> jquery's data attribute. It would be possible to get the
>> content
>>>> via
>>>>>>>>> inputstream of the httpservletrequest.
>> ((HttpServletRequest)RequestCycle.get().getRequest().getContainerRequest()).getInputStream()
>>>>>>>>> 
>>>>>>>>> kind regards
>>>>>>>>> 
>>>>>>>>> Tobias
>>>>>>>>> 
>>>>>>>>>> Am 15.09.2014 um 14:43 schrieb Martin Grigorov <
>>>>> mgrigorov@apache.org
>>>>>>> :
>>>>>>>>>> 
>>>>>>>>>> With HTTP you can send either string or binary.
>>>>>>>>>> You have to convert at the server side
>>>>>>>>>> On Sep 15, 2014 3:20 PM, "Tobias Soloschenko" <
>>>>>>>>>> tobiassoloschenko@googlemail.com> wrote:
>>>>>>>>>> 
>>>>>>>>>>> And how do I read the ep / dep in the backend if they aren't
>>> of
>>>>> Type
>>>>>>>>>>> String but a plain javascript object?
>>>>>>>>>>> 
>>>>>>>>>>> ty for the fast response!
>>>>>>>>>>> 
>>>>>>>>>>> Tobias
>>>>>>>>>>> 
>>>>>>>>>>>> Am 15.09.2014 um 14:16 schrieb Martin Grigorov <
>>>>>> mgrigorov@apache.org
>>>>>>>> :
>>>>>>>>>>>> 
>>>>>>>>>>>> http://markmail.org/message/fw7cjfo7bzvkjfdu
>>>>>>>>>>>> 
>>>>>>>>>>>> Martin Grigorov
>>>>>>>>>>>> Wicket Training and Consulting
>>>>>>>>>>>> https://twitter.com/mtgrigorov
>>>>>>>>>>>> 
>>>>>>>>>>>> On Mon, Sep 15, 2014 at 3:11 PM, Tobias Soloschenko <
>>>>>>>>>>>> tobiassoloschenko@googlemail.com> wrote:
>>>>>>>>>>>> 
>>>>>>>>>>>>> Hi,
>>>>>>>>>>>>> 
>>>>>>>>>>>>> is there a way to process post data with the wicket ajax
>>>>> function
>>>>>> -
>>>>>>> ep
>>>>>>>>>>> dep
>>>>>>>>>>>>> are only for strings.
>>>>>>>>>>>>> 
>>>>>>>>>>>>> Kind regards and thanks!
>>>>>>>>>>>>> 
>>>>>>>>>>>>> Tobias
>>> ---------------------------------------------------------------------
>>>>>>>>>>>>> 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
>>> 
>>> 
>>> 
>>> --
>>> Regards - Ernesto Reinaldo Barreiro
> 
> 
> 
> -- 
> Regards - Ernesto Reinaldo Barreiro

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


Re: Ajax Post Data

Posted by Ernesto Reinaldo Barreiro <re...@gmail.com>.
You can make it abstract with same callback methods as panel. Users can the
choose between panel or behavior.

On Mon, Sep 15, 2014 at 8:41 PM, Tobias Soloschenko <
tobiassoloschenko@googlemail.com> wrote:

> Hi,
>
> it is not public static because of the use of ids and because of the
> callback methods.
>
> kind regards
>
> Tobias
>
> 2014-09-15 20:37 GMT+02:00 Ernesto Reinaldo Barreiro <re...@gmail.com>:
>
> > Hi,
> >
> > Thanks for sharing! Why not make HTML5FilesDropableAjaxEventBehavior
> public
> > static so that it can be reused independently of Panel?
> >
> > On Mon, Sep 15, 2014 at 8:30 PM, Tobias Soloschenko <
> > tobiassoloschenko@googlemail.com> wrote:
> >
> > > Ok I solved my problem with the quickstart and some investigations
> about
> > > post requests:
> > >
> > >     var reader = new FileReader();
> > >     reader.onload = (function(file) {
> > >         return function(e) {
> > >             Wicket.Ajax.post({'u':'%s&fileName=' + encodeURIComponent(
> > > file.name) + '&dropid='+dropid+'&fileid=' + fileid,
> > >             ep:{data:btoa(reader.result)}, coh:[function(){
> > >                 // getFinishedUploadClientScript
> > >                 %s;
> > >             }]});
> > >         }
> > >     })(file);
> > >     reader.readAsBinaryString(file);
> > >
> > > I add the content of the file as base64 encoded binary string to the
> > > variable with the name data. The upload is now working like a charm.
> The
> > > only thing the developer has to know about is the max of mb (2mb in
> > example
> > > of tomcat) for post requests:
> > >
> > > https://github.com/klopfdreh/wicket-components-playground
> > >
> > > kind regards
> > >
> > > Tobias
> > >
> > >
> > > 2014-09-15 15:53 GMT+02:00 Martin Grigorov <mg...@apache.org>:
> > >
> > > > Please file a ticket with attached quickstart application.
> > > >
> > > > Martin Grigorov
> > > > Wicket Training and Consulting
> > > > https://twitter.com/mtgrigorov
> > > >
> > > > On Mon, Sep 15, 2014 at 4:44 PM, Tobias Soloschenko <
> > > > tobiassoloschenko@googlemail.com> wrote:
> > > >
> > > > > Let me show an example (%s are going to be replaced with the url /
> > > > > callbackscript):
> > > > >
> > > > >     $.ajax({
> > > > >         type : 'POST',
> > > > >         url : '%s&fileName=' + encodeURIComponent(file.name) +
> > > > > '&dropid='+dropid+'&fileid=' + fileid,
> > > > >         data : file,
> > > > >         contentType : false,
> > > > >         processData : false,
> > > > >
> > > > >         success:function(data, textStatus, jqXHR){
> > > > >             var file = this.data
> > > > >             // getFinishedUploadClientScript
> > > > >             %s
> > > > >         }
> > > > >     });
> > > > >
> > > > > With this code I can invoke this on server side and read the data:
> > > > > ((HttpServletRequest)
> > > > >
> > RequestCycle.get().getRequest().getContainerRequest()).getInputStream()
> > > > >
> > > > > ---
> > > > >
> > > > >     Wicket.Ajax.post({'u':'%s&fileName=' + encodeURIComponent(
> > > file.name)
> > > > +
> > > > > '&dropid='+dropid+'&fileid=' + fileid, ep:file,sh:function(){
> > > > >         // getFinishedUploadClientScript
> > > > >         %s;
> > > > >     }});
> > > > >
> > > > > This code is not working with the server side handling of the post
> > > > content
> > > > >
> > > > > kind regards
> > > > >
> > > > > Tobias
> > > > >
> > > > >
> > > > >
> > > > >
> > > > > 2014-09-15 15:38 GMT+02:00 Tobias Soloschenko <
> > > > > tobiassoloschenko@googlemail.com>:
> > > > >
> > > > > > No - I'm using Wicket.Ajax.post(...) - but if I do a normal
> $.ajax
> > > with
> > > > > --
> > > > > > type:post, contentType:false, processData:false --I can read the
> > > > content
> > > > > by
> > > > > > inputstream I saw that the attrs.ep are passed into the data
> > property
> > > > but
> > > > > > they are encoded which is wrong jQuery.param(data) line 634 of
> > > > > > wicket-ajax-jquery. And how can I set the other both options so
> > that
> > > I
> > > > > can
> > > > > > read the content via stream?
> > > > > >
> > > > > > Kind regards
> > > > > >
> > > > > > Tobias
> > > > > >
> > > > > > > Am 15.09.2014 um 15:28 schrieb Martin Grigorov <
> > > mgrigorov@apache.org
> > > > >:
> > > > > > >
> > > > > > > If you use Wicket.Ajax.post() or Wicket.Ajax.ajax({"m":"post",
> > > ....})
> > > > > > then
> > > > > > > the parameters won't be in the query string.
> > > > > > >
> > > > > > > wicket-ajax.js puts the parameters to $.ajax({data: HERE, ...})
> > and
> > > > > > > depending on the used 'method' (GET or POST) they will be in
> the
> > > > query
> > > > > > > string or request body.
> > > > > > >
> > > > > > > Do you say that with method=post you still see the parameter in
> > the
> > > > > query
> > > > > > > string ?
> > > > > > >
> > > > > > > Martin Grigorov
> > > > > > > Wicket Training and Consulting
> > > > > > > https://twitter.com/mtgrigorov
> > > > > > >
> > > > > > > On Mon, Sep 15, 2014 at 4:24 PM, Tobias Soloschenko <
> > > > > > > tobiassoloschenko@googlemail.com> wrote:
> > > > > > >
> > > > > > >> But they are add to the query string. This is really bad -
> maybe
> > > it
> > > > > > would
> > > > > > >> be nice to add a new special attribute which is given directly
> > to
> > > > the
> > > > > > >> jquery's data attribute. It would be possible to get the
> content
> > > via
> > > > > > >> inputstream of the httpservletrequest.
> > > > > > >>
> > > > > > >>
> > > > > > >>
> > > > > >
> > > > >
> > > >
> > >
> >
> ((HttpServletRequest)RequestCycle.get().getRequest().getContainerRequest()).getInputStream()
> > > > > > >>
> > > > > > >> kind regards
> > > > > > >>
> > > > > > >> Tobias
> > > > > > >>
> > > > > > >>> Am 15.09.2014 um 14:43 schrieb Martin Grigorov <
> > > > mgrigorov@apache.org
> > > > > >:
> > > > > > >>>
> > > > > > >>> With HTTP you can send either string or binary.
> > > > > > >>> You have to convert at the server side
> > > > > > >>> On Sep 15, 2014 3:20 PM, "Tobias Soloschenko" <
> > > > > > >>> tobiassoloschenko@googlemail.com> wrote:
> > > > > > >>>
> > > > > > >>>> And how do I read the ep / dep in the backend if they aren't
> > of
> > > > Type
> > > > > > >>>> String but a plain javascript object?
> > > > > > >>>>
> > > > > > >>>> ty for the fast response!
> > > > > > >>>>
> > > > > > >>>> Tobias
> > > > > > >>>>
> > > > > > >>>>> Am 15.09.2014 um 14:16 schrieb Martin Grigorov <
> > > > > mgrigorov@apache.org
> > > > > > >:
> > > > > > >>>>>
> > > > > > >>>>> http://markmail.org/message/fw7cjfo7bzvkjfdu
> > > > > > >>>>>
> > > > > > >>>>> Martin Grigorov
> > > > > > >>>>> Wicket Training and Consulting
> > > > > > >>>>> https://twitter.com/mtgrigorov
> > > > > > >>>>>
> > > > > > >>>>> On Mon, Sep 15, 2014 at 3:11 PM, Tobias Soloschenko <
> > > > > > >>>>> tobiassoloschenko@googlemail.com> wrote:
> > > > > > >>>>>
> > > > > > >>>>>> Hi,
> > > > > > >>>>>>
> > > > > > >>>>>> is there a way to process post data with the wicket ajax
> > > > function
> > > > > -
> > > > > > ep
> > > > > > >>>> dep
> > > > > > >>>>>> are only for strings.
> > > > > > >>>>>>
> > > > > > >>>>>> Kind regards and thanks!
> > > > > > >>>>>>
> > > > > > >>>>>> Tobias
> > > > > > >>>>>>
> > > > > >
> > ---------------------------------------------------------------------
> > > > > > >>>>>> 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
> > > > > > >>
> > > > > > >>
> > > > > >
> > > > >
> > > >
> > >
> >
> >
> >
> > --
> > Regards - Ernesto Reinaldo Barreiro
> >
>



-- 
Regards - Ernesto Reinaldo Barreiro

Re: Ajax Post Data

Posted by Tobias Soloschenko <to...@googlemail.com>.
Hi,

it is not public static because of the use of ids and because of the
callback methods.

kind regards

Tobias

2014-09-15 20:37 GMT+02:00 Ernesto Reinaldo Barreiro <re...@gmail.com>:

> Hi,
>
> Thanks for sharing! Why not make HTML5FilesDropableAjaxEventBehavior public
> static so that it can be reused independently of Panel?
>
> On Mon, Sep 15, 2014 at 8:30 PM, Tobias Soloschenko <
> tobiassoloschenko@googlemail.com> wrote:
>
> > Ok I solved my problem with the quickstart and some investigations about
> > post requests:
> >
> >     var reader = new FileReader();
> >     reader.onload = (function(file) {
> >         return function(e) {
> >             Wicket.Ajax.post({'u':'%s&fileName=' + encodeURIComponent(
> > file.name) + '&dropid='+dropid+'&fileid=' + fileid,
> >             ep:{data:btoa(reader.result)}, coh:[function(){
> >                 // getFinishedUploadClientScript
> >                 %s;
> >             }]});
> >         }
> >     })(file);
> >     reader.readAsBinaryString(file);
> >
> > I add the content of the file as base64 encoded binary string to the
> > variable with the name data. The upload is now working like a charm. The
> > only thing the developer has to know about is the max of mb (2mb in
> example
> > of tomcat) for post requests:
> >
> > https://github.com/klopfdreh/wicket-components-playground
> >
> > kind regards
> >
> > Tobias
> >
> >
> > 2014-09-15 15:53 GMT+02:00 Martin Grigorov <mg...@apache.org>:
> >
> > > Please file a ticket with attached quickstart application.
> > >
> > > Martin Grigorov
> > > Wicket Training and Consulting
> > > https://twitter.com/mtgrigorov
> > >
> > > On Mon, Sep 15, 2014 at 4:44 PM, Tobias Soloschenko <
> > > tobiassoloschenko@googlemail.com> wrote:
> > >
> > > > Let me show an example (%s are going to be replaced with the url /
> > > > callbackscript):
> > > >
> > > >     $.ajax({
> > > >         type : 'POST',
> > > >         url : '%s&fileName=' + encodeURIComponent(file.name) +
> > > > '&dropid='+dropid+'&fileid=' + fileid,
> > > >         data : file,
> > > >         contentType : false,
> > > >         processData : false,
> > > >
> > > >         success:function(data, textStatus, jqXHR){
> > > >             var file = this.data
> > > >             // getFinishedUploadClientScript
> > > >             %s
> > > >         }
> > > >     });
> > > >
> > > > With this code I can invoke this on server side and read the data:
> > > > ((HttpServletRequest)
> > > >
> RequestCycle.get().getRequest().getContainerRequest()).getInputStream()
> > > >
> > > > ---
> > > >
> > > >     Wicket.Ajax.post({'u':'%s&fileName=' + encodeURIComponent(
> > file.name)
> > > +
> > > > '&dropid='+dropid+'&fileid=' + fileid, ep:file,sh:function(){
> > > >         // getFinishedUploadClientScript
> > > >         %s;
> > > >     }});
> > > >
> > > > This code is not working with the server side handling of the post
> > > content
> > > >
> > > > kind regards
> > > >
> > > > Tobias
> > > >
> > > >
> > > >
> > > >
> > > > 2014-09-15 15:38 GMT+02:00 Tobias Soloschenko <
> > > > tobiassoloschenko@googlemail.com>:
> > > >
> > > > > No - I'm using Wicket.Ajax.post(...) - but if I do a normal $.ajax
> > with
> > > > --
> > > > > type:post, contentType:false, processData:false --I can read the
> > > content
> > > > by
> > > > > inputstream I saw that the attrs.ep are passed into the data
> property
> > > but
> > > > > they are encoded which is wrong jQuery.param(data) line 634 of
> > > > > wicket-ajax-jquery. And how can I set the other both options so
> that
> > I
> > > > can
> > > > > read the content via stream?
> > > > >
> > > > > Kind regards
> > > > >
> > > > > Tobias
> > > > >
> > > > > > Am 15.09.2014 um 15:28 schrieb Martin Grigorov <
> > mgrigorov@apache.org
> > > >:
> > > > > >
> > > > > > If you use Wicket.Ajax.post() or Wicket.Ajax.ajax({"m":"post",
> > ....})
> > > > > then
> > > > > > the parameters won't be in the query string.
> > > > > >
> > > > > > wicket-ajax.js puts the parameters to $.ajax({data: HERE, ...})
> and
> > > > > > depending on the used 'method' (GET or POST) they will be in the
> > > query
> > > > > > string or request body.
> > > > > >
> > > > > > Do you say that with method=post you still see the parameter in
> the
> > > > query
> > > > > > string ?
> > > > > >
> > > > > > Martin Grigorov
> > > > > > Wicket Training and Consulting
> > > > > > https://twitter.com/mtgrigorov
> > > > > >
> > > > > > On Mon, Sep 15, 2014 at 4:24 PM, Tobias Soloschenko <
> > > > > > tobiassoloschenko@googlemail.com> wrote:
> > > > > >
> > > > > >> But they are add to the query string. This is really bad - maybe
> > it
> > > > > would
> > > > > >> be nice to add a new special attribute which is given directly
> to
> > > the
> > > > > >> jquery's data attribute. It would be possible to get the content
> > via
> > > > > >> inputstream of the httpservletrequest.
> > > > > >>
> > > > > >>
> > > > > >>
> > > > >
> > > >
> > >
> >
> ((HttpServletRequest)RequestCycle.get().getRequest().getContainerRequest()).getInputStream()
> > > > > >>
> > > > > >> kind regards
> > > > > >>
> > > > > >> Tobias
> > > > > >>
> > > > > >>> Am 15.09.2014 um 14:43 schrieb Martin Grigorov <
> > > mgrigorov@apache.org
> > > > >:
> > > > > >>>
> > > > > >>> With HTTP you can send either string or binary.
> > > > > >>> You have to convert at the server side
> > > > > >>> On Sep 15, 2014 3:20 PM, "Tobias Soloschenko" <
> > > > > >>> tobiassoloschenko@googlemail.com> wrote:
> > > > > >>>
> > > > > >>>> And how do I read the ep / dep in the backend if they aren't
> of
> > > Type
> > > > > >>>> String but a plain javascript object?
> > > > > >>>>
> > > > > >>>> ty for the fast response!
> > > > > >>>>
> > > > > >>>> Tobias
> > > > > >>>>
> > > > > >>>>> Am 15.09.2014 um 14:16 schrieb Martin Grigorov <
> > > > mgrigorov@apache.org
> > > > > >:
> > > > > >>>>>
> > > > > >>>>> http://markmail.org/message/fw7cjfo7bzvkjfdu
> > > > > >>>>>
> > > > > >>>>> Martin Grigorov
> > > > > >>>>> Wicket Training and Consulting
> > > > > >>>>> https://twitter.com/mtgrigorov
> > > > > >>>>>
> > > > > >>>>> On Mon, Sep 15, 2014 at 3:11 PM, Tobias Soloschenko <
> > > > > >>>>> tobiassoloschenko@googlemail.com> wrote:
> > > > > >>>>>
> > > > > >>>>>> Hi,
> > > > > >>>>>>
> > > > > >>>>>> is there a way to process post data with the wicket ajax
> > > function
> > > > -
> > > > > ep
> > > > > >>>> dep
> > > > > >>>>>> are only for strings.
> > > > > >>>>>>
> > > > > >>>>>> Kind regards and thanks!
> > > > > >>>>>>
> > > > > >>>>>> Tobias
> > > > > >>>>>>
> > > > >
> ---------------------------------------------------------------------
> > > > > >>>>>> 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
> > > > > >>
> > > > > >>
> > > > >
> > > >
> > >
> >
>
>
>
> --
> Regards - Ernesto Reinaldo Barreiro
>

Re: Ajax Post Data

Posted by Ernesto Reinaldo Barreiro <re...@gmail.com>.
Hi,

Thanks for sharing! Why not make HTML5FilesDropableAjaxEventBehavior public
static so that it can be reused independently of Panel?

On Mon, Sep 15, 2014 at 8:30 PM, Tobias Soloschenko <
tobiassoloschenko@googlemail.com> wrote:

> Ok I solved my problem with the quickstart and some investigations about
> post requests:
>
>     var reader = new FileReader();
>     reader.onload = (function(file) {
>         return function(e) {
>             Wicket.Ajax.post({'u':'%s&fileName=' + encodeURIComponent(
> file.name) + '&dropid='+dropid+'&fileid=' + fileid,
>             ep:{data:btoa(reader.result)}, coh:[function(){
>                 // getFinishedUploadClientScript
>                 %s;
>             }]});
>         }
>     })(file);
>     reader.readAsBinaryString(file);
>
> I add the content of the file as base64 encoded binary string to the
> variable with the name data. The upload is now working like a charm. The
> only thing the developer has to know about is the max of mb (2mb in example
> of tomcat) for post requests:
>
> https://github.com/klopfdreh/wicket-components-playground
>
> kind regards
>
> Tobias
>
>
> 2014-09-15 15:53 GMT+02:00 Martin Grigorov <mg...@apache.org>:
>
> > Please file a ticket with attached quickstart application.
> >
> > Martin Grigorov
> > Wicket Training and Consulting
> > https://twitter.com/mtgrigorov
> >
> > On Mon, Sep 15, 2014 at 4:44 PM, Tobias Soloschenko <
> > tobiassoloschenko@googlemail.com> wrote:
> >
> > > Let me show an example (%s are going to be replaced with the url /
> > > callbackscript):
> > >
> > >     $.ajax({
> > >         type : 'POST',
> > >         url : '%s&fileName=' + encodeURIComponent(file.name) +
> > > '&dropid='+dropid+'&fileid=' + fileid,
> > >         data : file,
> > >         contentType : false,
> > >         processData : false,
> > >
> > >         success:function(data, textStatus, jqXHR){
> > >             var file = this.data
> > >             // getFinishedUploadClientScript
> > >             %s
> > >         }
> > >     });
> > >
> > > With this code I can invoke this on server side and read the data:
> > > ((HttpServletRequest)
> > > RequestCycle.get().getRequest().getContainerRequest()).getInputStream()
> > >
> > > ---
> > >
> > >     Wicket.Ajax.post({'u':'%s&fileName=' + encodeURIComponent(
> file.name)
> > +
> > > '&dropid='+dropid+'&fileid=' + fileid, ep:file,sh:function(){
> > >         // getFinishedUploadClientScript
> > >         %s;
> > >     }});
> > >
> > > This code is not working with the server side handling of the post
> > content
> > >
> > > kind regards
> > >
> > > Tobias
> > >
> > >
> > >
> > >
> > > 2014-09-15 15:38 GMT+02:00 Tobias Soloschenko <
> > > tobiassoloschenko@googlemail.com>:
> > >
> > > > No - I'm using Wicket.Ajax.post(...) - but if I do a normal $.ajax
> with
> > > --
> > > > type:post, contentType:false, processData:false --I can read the
> > content
> > > by
> > > > inputstream I saw that the attrs.ep are passed into the data property
> > but
> > > > they are encoded which is wrong jQuery.param(data) line 634 of
> > > > wicket-ajax-jquery. And how can I set the other both options so that
> I
> > > can
> > > > read the content via stream?
> > > >
> > > > Kind regards
> > > >
> > > > Tobias
> > > >
> > > > > Am 15.09.2014 um 15:28 schrieb Martin Grigorov <
> mgrigorov@apache.org
> > >:
> > > > >
> > > > > If you use Wicket.Ajax.post() or Wicket.Ajax.ajax({"m":"post",
> ....})
> > > > then
> > > > > the parameters won't be in the query string.
> > > > >
> > > > > wicket-ajax.js puts the parameters to $.ajax({data: HERE, ...}) and
> > > > > depending on the used 'method' (GET or POST) they will be in the
> > query
> > > > > string or request body.
> > > > >
> > > > > Do you say that with method=post you still see the parameter in the
> > > query
> > > > > string ?
> > > > >
> > > > > Martin Grigorov
> > > > > Wicket Training and Consulting
> > > > > https://twitter.com/mtgrigorov
> > > > >
> > > > > On Mon, Sep 15, 2014 at 4:24 PM, Tobias Soloschenko <
> > > > > tobiassoloschenko@googlemail.com> wrote:
> > > > >
> > > > >> But they are add to the query string. This is really bad - maybe
> it
> > > > would
> > > > >> be nice to add a new special attribute which is given directly to
> > the
> > > > >> jquery's data attribute. It would be possible to get the content
> via
> > > > >> inputstream of the httpservletrequest.
> > > > >>
> > > > >>
> > > > >>
> > > >
> > >
> >
> ((HttpServletRequest)RequestCycle.get().getRequest().getContainerRequest()).getInputStream()
> > > > >>
> > > > >> kind regards
> > > > >>
> > > > >> Tobias
> > > > >>
> > > > >>> Am 15.09.2014 um 14:43 schrieb Martin Grigorov <
> > mgrigorov@apache.org
> > > >:
> > > > >>>
> > > > >>> With HTTP you can send either string or binary.
> > > > >>> You have to convert at the server side
> > > > >>> On Sep 15, 2014 3:20 PM, "Tobias Soloschenko" <
> > > > >>> tobiassoloschenko@googlemail.com> wrote:
> > > > >>>
> > > > >>>> And how do I read the ep / dep in the backend if they aren't of
> > Type
> > > > >>>> String but a plain javascript object?
> > > > >>>>
> > > > >>>> ty for the fast response!
> > > > >>>>
> > > > >>>> Tobias
> > > > >>>>
> > > > >>>>> Am 15.09.2014 um 14:16 schrieb Martin Grigorov <
> > > mgrigorov@apache.org
> > > > >:
> > > > >>>>>
> > > > >>>>> http://markmail.org/message/fw7cjfo7bzvkjfdu
> > > > >>>>>
> > > > >>>>> Martin Grigorov
> > > > >>>>> Wicket Training and Consulting
> > > > >>>>> https://twitter.com/mtgrigorov
> > > > >>>>>
> > > > >>>>> On Mon, Sep 15, 2014 at 3:11 PM, Tobias Soloschenko <
> > > > >>>>> tobiassoloschenko@googlemail.com> wrote:
> > > > >>>>>
> > > > >>>>>> Hi,
> > > > >>>>>>
> > > > >>>>>> is there a way to process post data with the wicket ajax
> > function
> > > -
> > > > ep
> > > > >>>> dep
> > > > >>>>>> are only for strings.
> > > > >>>>>>
> > > > >>>>>> Kind regards and thanks!
> > > > >>>>>>
> > > > >>>>>> Tobias
> > > > >>>>>>
> > > > ---------------------------------------------------------------------
> > > > >>>>>> 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
> > > > >>
> > > > >>
> > > >
> > >
> >
>



-- 
Regards - Ernesto Reinaldo Barreiro

Re: Ajax Post Data

Posted by Tobias Soloschenko <to...@googlemail.com>.
As request-body - everything is ok

kind regards

Tobias

> Am 16.09.2014 um 08:51 schrieb Martin Grigorov <mg...@apache.org>:
> 
> Hi Tobias,
> 
> On Mon, Sep 15, 2014 at 9:30 PM, Tobias Soloschenko <
> tobiassoloschenko@googlemail.com> wrote:
> 
>> Ok I solved my problem with the quickstart and some investigations about
>> post requests:
>> 
>>    var reader = new FileReader();
>>    reader.onload = (function(file) {
>>        return function(e) {
>>            Wicket.Ajax.post({'u':'%s&fileName=' + encodeURIComponent(
>> file.name) + '&dropid='+dropid+'&fileid=' + fileid,
>>            ep:{data:btoa(reader.result)}, coh:[function(){
>>                // getFinishedUploadClientScript
>>                %s;
>>            }]});
>>        }
>>    })(file);
>>    reader.readAsBinaryString(file);
>> 
>> I add the content of the file as base64 encoded binary string to the
> 
> Is the base64 encoded string sent as part of the query string or as request
> body ?
> 
> 
>> variable with the name data. The upload is now working like a charm. The
>> only thing the developer has to know about is the max of mb (2mb in example
>> of tomcat) for post requests:
>> 
>> https://github.com/klopfdreh/wicket-components-playground
>> 
>> kind regards
>> 
>> Tobias
>> 
>> 
>> 2014-09-15 15:53 GMT+02:00 Martin Grigorov <mg...@apache.org>:
>> 
>>> Please file a ticket with attached quickstart application.
>>> 
>>> Martin Grigorov
>>> Wicket Training and Consulting
>>> https://twitter.com/mtgrigorov
>>> 
>>> On Mon, Sep 15, 2014 at 4:44 PM, Tobias Soloschenko <
>>> tobiassoloschenko@googlemail.com> wrote:
>>> 
>>>> Let me show an example (%s are going to be replaced with the url /
>>>> callbackscript):
>>>> 
>>>>    $.ajax({
>>>>        type : 'POST',
>>>>        url : '%s&fileName=' + encodeURIComponent(file.name) +
>>>> '&dropid='+dropid+'&fileid=' + fileid,
>>>>        data : file,
>>>>        contentType : false,
>>>>        processData : false,
>>>> 
>>>>        success:function(data, textStatus, jqXHR){
>>>>            var file = this.data
>>>>            // getFinishedUploadClientScript
>>>>            %s
>>>>        }
>>>>    });
>>>> 
>>>> With this code I can invoke this on server side and read the data:
>>>> ((HttpServletRequest)
>>>> RequestCycle.get().getRequest().getContainerRequest()).getInputStream()
>>>> 
>>>> ---
>>>> 
>>>>    Wicket.Ajax.post({'u':'%s&fileName=' + encodeURIComponent(
>> file.name)
>>> +
>>>> '&dropid='+dropid+'&fileid=' + fileid, ep:file,sh:function(){
>>>>        // getFinishedUploadClientScript
>>>>        %s;
>>>>    }});
>>>> 
>>>> This code is not working with the server side handling of the post
>>> content
>>>> 
>>>> kind regards
>>>> 
>>>> Tobias
>>>> 
>>>> 
>>>> 
>>>> 
>>>> 2014-09-15 15:38 GMT+02:00 Tobias Soloschenko <
>>>> tobiassoloschenko@googlemail.com>:
>>>> 
>>>>> No - I'm using Wicket.Ajax.post(...) - but if I do a normal $.ajax
>> with
>>>> --
>>>>> type:post, contentType:false, processData:false --I can read the
>>> content
>>>> by
>>>>> inputstream I saw that the attrs.ep are passed into the data property
>>> but
>>>>> they are encoded which is wrong jQuery.param(data) line 634 of
>>>>> wicket-ajax-jquery. And how can I set the other both options so that
>> I
>>>> can
>>>>> read the content via stream?
>>>>> 
>>>>> Kind regards
>>>>> 
>>>>> Tobias
>>>>> 
>>>>>> Am 15.09.2014 um 15:28 schrieb Martin Grigorov <
>> mgrigorov@apache.org
>>>> :
>>>>>> 
>>>>>> If you use Wicket.Ajax.post() or Wicket.Ajax.ajax({"m":"post",
>> ....})
>>>>> then
>>>>>> the parameters won't be in the query string.
>>>>>> 
>>>>>> wicket-ajax.js puts the parameters to $.ajax({data: HERE, ...}) and
>>>>>> depending on the used 'method' (GET or POST) they will be in the
>>> query
>>>>>> string or request body.
>>>>>> 
>>>>>> Do you say that with method=post you still see the parameter in the
>>>> query
>>>>>> string ?
>>>>>> 
>>>>>> Martin Grigorov
>>>>>> Wicket Training and Consulting
>>>>>> https://twitter.com/mtgrigorov
>>>>>> 
>>>>>> On Mon, Sep 15, 2014 at 4:24 PM, Tobias Soloschenko <
>>>>>> tobiassoloschenko@googlemail.com> wrote:
>>>>>> 
>>>>>>> But they are add to the query string. This is really bad - maybe
>> it
>>>>> would
>>>>>>> be nice to add a new special attribute which is given directly to
>>> the
>>>>>>> jquery's data attribute. It would be possible to get the content
>> via
>>>>>>> inputstream of the httpservletrequest.
>> ((HttpServletRequest)RequestCycle.get().getRequest().getContainerRequest()).getInputStream()
>>>>>>> 
>>>>>>> kind regards
>>>>>>> 
>>>>>>> Tobias
>>>>>>> 
>>>>>>>> Am 15.09.2014 um 14:43 schrieb Martin Grigorov <
>>> mgrigorov@apache.org
>>>>> :
>>>>>>>> 
>>>>>>>> With HTTP you can send either string or binary.
>>>>>>>> You have to convert at the server side
>>>>>>>> On Sep 15, 2014 3:20 PM, "Tobias Soloschenko" <
>>>>>>>> tobiassoloschenko@googlemail.com> wrote:
>>>>>>>> 
>>>>>>>>> And how do I read the ep / dep in the backend if they aren't of
>>> Type
>>>>>>>>> String but a plain javascript object?
>>>>>>>>> 
>>>>>>>>> ty for the fast response!
>>>>>>>>> 
>>>>>>>>> Tobias
>>>>>>>>> 
>>>>>>>>>> Am 15.09.2014 um 14:16 schrieb Martin Grigorov <
>>>> mgrigorov@apache.org
>>>>>> :
>>>>>>>>>> 
>>>>>>>>>> http://markmail.org/message/fw7cjfo7bzvkjfdu
>>>>>>>>>> 
>>>>>>>>>> Martin Grigorov
>>>>>>>>>> Wicket Training and Consulting
>>>>>>>>>> https://twitter.com/mtgrigorov
>>>>>>>>>> 
>>>>>>>>>> On Mon, Sep 15, 2014 at 3:11 PM, Tobias Soloschenko <
>>>>>>>>>> tobiassoloschenko@googlemail.com> wrote:
>>>>>>>>>> 
>>>>>>>>>>> Hi,
>>>>>>>>>>> 
>>>>>>>>>>> is there a way to process post data with the wicket ajax
>>> function
>>>> -
>>>>> ep
>>>>>>>>> dep
>>>>>>>>>>> are only for strings.
>>>>>>>>>>> 
>>>>>>>>>>> Kind regards and thanks!
>>>>>>>>>>> 
>>>>>>>>>>> Tobias
>>>>> ---------------------------------------------------------------------
>>>>>>>>>>> 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
>> 

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


Re: Ajax Post Data

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

On Mon, Sep 15, 2014 at 9:30 PM, Tobias Soloschenko <
tobiassoloschenko@googlemail.com> wrote:

> Ok I solved my problem with the quickstart and some investigations about
> post requests:
>
>     var reader = new FileReader();
>     reader.onload = (function(file) {
>         return function(e) {
>             Wicket.Ajax.post({'u':'%s&fileName=' + encodeURIComponent(
> file.name) + '&dropid='+dropid+'&fileid=' + fileid,
>             ep:{data:btoa(reader.result)}, coh:[function(){
>                 // getFinishedUploadClientScript
>                 %s;
>             }]});
>         }
>     })(file);
>     reader.readAsBinaryString(file);
>
> I add the content of the file as base64 encoded binary string to the
>

Is the base64 encoded string sent as part of the query string or as request
body ?


> variable with the name data. The upload is now working like a charm. The
> only thing the developer has to know about is the max of mb (2mb in example
> of tomcat) for post requests:
>
> https://github.com/klopfdreh/wicket-components-playground
>
> kind regards
>
> Tobias
>
>
> 2014-09-15 15:53 GMT+02:00 Martin Grigorov <mg...@apache.org>:
>
> > Please file a ticket with attached quickstart application.
> >
> > Martin Grigorov
> > Wicket Training and Consulting
> > https://twitter.com/mtgrigorov
> >
> > On Mon, Sep 15, 2014 at 4:44 PM, Tobias Soloschenko <
> > tobiassoloschenko@googlemail.com> wrote:
> >
> > > Let me show an example (%s are going to be replaced with the url /
> > > callbackscript):
> > >
> > >     $.ajax({
> > >         type : 'POST',
> > >         url : '%s&fileName=' + encodeURIComponent(file.name) +
> > > '&dropid='+dropid+'&fileid=' + fileid,
> > >         data : file,
> > >         contentType : false,
> > >         processData : false,
> > >
> > >         success:function(data, textStatus, jqXHR){
> > >             var file = this.data
> > >             // getFinishedUploadClientScript
> > >             %s
> > >         }
> > >     });
> > >
> > > With this code I can invoke this on server side and read the data:
> > > ((HttpServletRequest)
> > > RequestCycle.get().getRequest().getContainerRequest()).getInputStream()
> > >
> > > ---
> > >
> > >     Wicket.Ajax.post({'u':'%s&fileName=' + encodeURIComponent(
> file.name)
> > +
> > > '&dropid='+dropid+'&fileid=' + fileid, ep:file,sh:function(){
> > >         // getFinishedUploadClientScript
> > >         %s;
> > >     }});
> > >
> > > This code is not working with the server side handling of the post
> > content
> > >
> > > kind regards
> > >
> > > Tobias
> > >
> > >
> > >
> > >
> > > 2014-09-15 15:38 GMT+02:00 Tobias Soloschenko <
> > > tobiassoloschenko@googlemail.com>:
> > >
> > > > No - I'm using Wicket.Ajax.post(...) - but if I do a normal $.ajax
> with
> > > --
> > > > type:post, contentType:false, processData:false --I can read the
> > content
> > > by
> > > > inputstream I saw that the attrs.ep are passed into the data property
> > but
> > > > they are encoded which is wrong jQuery.param(data) line 634 of
> > > > wicket-ajax-jquery. And how can I set the other both options so that
> I
> > > can
> > > > read the content via stream?
> > > >
> > > > Kind regards
> > > >
> > > > Tobias
> > > >
> > > > > Am 15.09.2014 um 15:28 schrieb Martin Grigorov <
> mgrigorov@apache.org
> > >:
> > > > >
> > > > > If you use Wicket.Ajax.post() or Wicket.Ajax.ajax({"m":"post",
> ....})
> > > > then
> > > > > the parameters won't be in the query string.
> > > > >
> > > > > wicket-ajax.js puts the parameters to $.ajax({data: HERE, ...}) and
> > > > > depending on the used 'method' (GET or POST) they will be in the
> > query
> > > > > string or request body.
> > > > >
> > > > > Do you say that with method=post you still see the parameter in the
> > > query
> > > > > string ?
> > > > >
> > > > > Martin Grigorov
> > > > > Wicket Training and Consulting
> > > > > https://twitter.com/mtgrigorov
> > > > >
> > > > > On Mon, Sep 15, 2014 at 4:24 PM, Tobias Soloschenko <
> > > > > tobiassoloschenko@googlemail.com> wrote:
> > > > >
> > > > >> But they are add to the query string. This is really bad - maybe
> it
> > > > would
> > > > >> be nice to add a new special attribute which is given directly to
> > the
> > > > >> jquery's data attribute. It would be possible to get the content
> via
> > > > >> inputstream of the httpservletrequest.
> > > > >>
> > > > >>
> > > > >>
> > > >
> > >
> >
> ((HttpServletRequest)RequestCycle.get().getRequest().getContainerRequest()).getInputStream()
> > > > >>
> > > > >> kind regards
> > > > >>
> > > > >> Tobias
> > > > >>
> > > > >>> Am 15.09.2014 um 14:43 schrieb Martin Grigorov <
> > mgrigorov@apache.org
> > > >:
> > > > >>>
> > > > >>> With HTTP you can send either string or binary.
> > > > >>> You have to convert at the server side
> > > > >>> On Sep 15, 2014 3:20 PM, "Tobias Soloschenko" <
> > > > >>> tobiassoloschenko@googlemail.com> wrote:
> > > > >>>
> > > > >>>> And how do I read the ep / dep in the backend if they aren't of
> > Type
> > > > >>>> String but a plain javascript object?
> > > > >>>>
> > > > >>>> ty for the fast response!
> > > > >>>>
> > > > >>>> Tobias
> > > > >>>>
> > > > >>>>> Am 15.09.2014 um 14:16 schrieb Martin Grigorov <
> > > mgrigorov@apache.org
> > > > >:
> > > > >>>>>
> > > > >>>>> http://markmail.org/message/fw7cjfo7bzvkjfdu
> > > > >>>>>
> > > > >>>>> Martin Grigorov
> > > > >>>>> Wicket Training and Consulting
> > > > >>>>> https://twitter.com/mtgrigorov
> > > > >>>>>
> > > > >>>>> On Mon, Sep 15, 2014 at 3:11 PM, Tobias Soloschenko <
> > > > >>>>> tobiassoloschenko@googlemail.com> wrote:
> > > > >>>>>
> > > > >>>>>> Hi,
> > > > >>>>>>
> > > > >>>>>> is there a way to process post data with the wicket ajax
> > function
> > > -
> > > > ep
> > > > >>>> dep
> > > > >>>>>> are only for strings.
> > > > >>>>>>
> > > > >>>>>> Kind regards and thanks!
> > > > >>>>>>
> > > > >>>>>> Tobias
> > > > >>>>>>
> > > > ---------------------------------------------------------------------
> > > > >>>>>> 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: Ajax Post Data

Posted by Tobias Soloschenko <to...@googlemail.com>.
Ok I solved my problem with the quickstart and some investigations about
post requests:

    var reader = new FileReader();
    reader.onload = (function(file) {
        return function(e) {
            Wicket.Ajax.post({'u':'%s&fileName=' + encodeURIComponent(
file.name) + '&dropid='+dropid+'&fileid=' + fileid,
            ep:{data:btoa(reader.result)}, coh:[function(){
                // getFinishedUploadClientScript
                %s;
            }]});
        }
    })(file);
    reader.readAsBinaryString(file);

I add the content of the file as base64 encoded binary string to the
variable with the name data. The upload is now working like a charm. The
only thing the developer has to know about is the max of mb (2mb in example
of tomcat) for post requests:

https://github.com/klopfdreh/wicket-components-playground

kind regards

Tobias


2014-09-15 15:53 GMT+02:00 Martin Grigorov <mg...@apache.org>:

> Please file a ticket with attached quickstart application.
>
> Martin Grigorov
> Wicket Training and Consulting
> https://twitter.com/mtgrigorov
>
> On Mon, Sep 15, 2014 at 4:44 PM, Tobias Soloschenko <
> tobiassoloschenko@googlemail.com> wrote:
>
> > Let me show an example (%s are going to be replaced with the url /
> > callbackscript):
> >
> >     $.ajax({
> >         type : 'POST',
> >         url : '%s&fileName=' + encodeURIComponent(file.name) +
> > '&dropid='+dropid+'&fileid=' + fileid,
> >         data : file,
> >         contentType : false,
> >         processData : false,
> >
> >         success:function(data, textStatus, jqXHR){
> >             var file = this.data
> >             // getFinishedUploadClientScript
> >             %s
> >         }
> >     });
> >
> > With this code I can invoke this on server side and read the data:
> > ((HttpServletRequest)
> > RequestCycle.get().getRequest().getContainerRequest()).getInputStream()
> >
> > ---
> >
> >     Wicket.Ajax.post({'u':'%s&fileName=' + encodeURIComponent(file.name)
> +
> > '&dropid='+dropid+'&fileid=' + fileid, ep:file,sh:function(){
> >         // getFinishedUploadClientScript
> >         %s;
> >     }});
> >
> > This code is not working with the server side handling of the post
> content
> >
> > kind regards
> >
> > Tobias
> >
> >
> >
> >
> > 2014-09-15 15:38 GMT+02:00 Tobias Soloschenko <
> > tobiassoloschenko@googlemail.com>:
> >
> > > No - I'm using Wicket.Ajax.post(...) - but if I do a normal $.ajax with
> > --
> > > type:post, contentType:false, processData:false --I can read the
> content
> > by
> > > inputstream I saw that the attrs.ep are passed into the data property
> but
> > > they are encoded which is wrong jQuery.param(data) line 634 of
> > > wicket-ajax-jquery. And how can I set the other both options so that I
> > can
> > > read the content via stream?
> > >
> > > Kind regards
> > >
> > > Tobias
> > >
> > > > Am 15.09.2014 um 15:28 schrieb Martin Grigorov <mgrigorov@apache.org
> >:
> > > >
> > > > If you use Wicket.Ajax.post() or Wicket.Ajax.ajax({"m":"post", ....})
> > > then
> > > > the parameters won't be in the query string.
> > > >
> > > > wicket-ajax.js puts the parameters to $.ajax({data: HERE, ...}) and
> > > > depending on the used 'method' (GET or POST) they will be in the
> query
> > > > string or request body.
> > > >
> > > > Do you say that with method=post you still see the parameter in the
> > query
> > > > string ?
> > > >
> > > > Martin Grigorov
> > > > Wicket Training and Consulting
> > > > https://twitter.com/mtgrigorov
> > > >
> > > > On Mon, Sep 15, 2014 at 4:24 PM, Tobias Soloschenko <
> > > > tobiassoloschenko@googlemail.com> wrote:
> > > >
> > > >> But they are add to the query string. This is really bad - maybe it
> > > would
> > > >> be nice to add a new special attribute which is given directly to
> the
> > > >> jquery's data attribute. It would be possible to get the content via
> > > >> inputstream of the httpservletrequest.
> > > >>
> > > >>
> > > >>
> > >
> >
> ((HttpServletRequest)RequestCycle.get().getRequest().getContainerRequest()).getInputStream()
> > > >>
> > > >> kind regards
> > > >>
> > > >> Tobias
> > > >>
> > > >>> Am 15.09.2014 um 14:43 schrieb Martin Grigorov <
> mgrigorov@apache.org
> > >:
> > > >>>
> > > >>> With HTTP you can send either string or binary.
> > > >>> You have to convert at the server side
> > > >>> On Sep 15, 2014 3:20 PM, "Tobias Soloschenko" <
> > > >>> tobiassoloschenko@googlemail.com> wrote:
> > > >>>
> > > >>>> And how do I read the ep / dep in the backend if they aren't of
> Type
> > > >>>> String but a plain javascript object?
> > > >>>>
> > > >>>> ty for the fast response!
> > > >>>>
> > > >>>> Tobias
> > > >>>>
> > > >>>>> Am 15.09.2014 um 14:16 schrieb Martin Grigorov <
> > mgrigorov@apache.org
> > > >:
> > > >>>>>
> > > >>>>> http://markmail.org/message/fw7cjfo7bzvkjfdu
> > > >>>>>
> > > >>>>> Martin Grigorov
> > > >>>>> Wicket Training and Consulting
> > > >>>>> https://twitter.com/mtgrigorov
> > > >>>>>
> > > >>>>> On Mon, Sep 15, 2014 at 3:11 PM, Tobias Soloschenko <
> > > >>>>> tobiassoloschenko@googlemail.com> wrote:
> > > >>>>>
> > > >>>>>> Hi,
> > > >>>>>>
> > > >>>>>> is there a way to process post data with the wicket ajax
> function
> > -
> > > ep
> > > >>>> dep
> > > >>>>>> are only for strings.
> > > >>>>>>
> > > >>>>>> Kind regards and thanks!
> > > >>>>>>
> > > >>>>>> Tobias
> > > >>>>>>
> > > ---------------------------------------------------------------------
> > > >>>>>> 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: Ajax Post Data

Posted by Tobias Soloschenko <to...@googlemail.com>.
Okay will do it when Im at home. :-) 

kind regards

Tobias 

> Am 15.09.2014 um 15:53 schrieb Martin Grigorov <mg...@apache.org>:
> 
> Please file a ticket with attached quickstart application.
> 
> Martin Grigorov
> Wicket Training and Consulting
> https://twitter.com/mtgrigorov
> 
> On Mon, Sep 15, 2014 at 4:44 PM, Tobias Soloschenko <
> tobiassoloschenko@googlemail.com> wrote:
> 
>> Let me show an example (%s are going to be replaced with the url /
>> callbackscript):
>> 
>>    $.ajax({
>>        type : 'POST',
>>        url : '%s&fileName=' + encodeURIComponent(file.name) +
>> '&dropid='+dropid+'&fileid=' + fileid,
>>        data : file,
>>        contentType : false,
>>        processData : false,
>> 
>>        success:function(data, textStatus, jqXHR){
>>            var file = this.data
>>            // getFinishedUploadClientScript
>>            %s
>>        }
>>    });
>> 
>> With this code I can invoke this on server side and read the data:
>> ((HttpServletRequest)
>> RequestCycle.get().getRequest().getContainerRequest()).getInputStream()
>> 
>> ---
>> 
>>    Wicket.Ajax.post({'u':'%s&fileName=' + encodeURIComponent(file.name) +
>> '&dropid='+dropid+'&fileid=' + fileid, ep:file,sh:function(){
>>        // getFinishedUploadClientScript
>>        %s;
>>    }});
>> 
>> This code is not working with the server side handling of the post content
>> 
>> kind regards
>> 
>> Tobias
>> 
>> 
>> 
>> 
>> 2014-09-15 15:38 GMT+02:00 Tobias Soloschenko <
>> tobiassoloschenko@googlemail.com>:
>> 
>>> No - I'm using Wicket.Ajax.post(...) - but if I do a normal $.ajax with
>> --
>>> type:post, contentType:false, processData:false --I can read the content
>> by
>>> inputstream I saw that the attrs.ep are passed into the data property but
>>> they are encoded which is wrong jQuery.param(data) line 634 of
>>> wicket-ajax-jquery. And how can I set the other both options so that I
>> can
>>> read the content via stream?
>>> 
>>> Kind regards
>>> 
>>> Tobias
>>> 
>>>> Am 15.09.2014 um 15:28 schrieb Martin Grigorov <mg...@apache.org>:
>>>> 
>>>> If you use Wicket.Ajax.post() or Wicket.Ajax.ajax({"m":"post", ....})
>>> then
>>>> the parameters won't be in the query string.
>>>> 
>>>> wicket-ajax.js puts the parameters to $.ajax({data: HERE, ...}) and
>>>> depending on the used 'method' (GET or POST) they will be in the query
>>>> string or request body.
>>>> 
>>>> Do you say that with method=post you still see the parameter in the
>> query
>>>> string ?
>>>> 
>>>> Martin Grigorov
>>>> Wicket Training and Consulting
>>>> https://twitter.com/mtgrigorov
>>>> 
>>>> On Mon, Sep 15, 2014 at 4:24 PM, Tobias Soloschenko <
>>>> tobiassoloschenko@googlemail.com> wrote:
>>>> 
>>>>> But they are add to the query string. This is really bad - maybe it
>>> would
>>>>> be nice to add a new special attribute which is given directly to the
>>>>> jquery's data attribute. It would be possible to get the content via
>>>>> inputstream of the httpservletrequest.
>> ((HttpServletRequest)RequestCycle.get().getRequest().getContainerRequest()).getInputStream()
>>>>> 
>>>>> kind regards
>>>>> 
>>>>> Tobias
>>>>> 
>>>>>> Am 15.09.2014 um 14:43 schrieb Martin Grigorov <mgrigorov@apache.org
>>> :
>>>>>> 
>>>>>> With HTTP you can send either string or binary.
>>>>>> You have to convert at the server side
>>>>>> On Sep 15, 2014 3:20 PM, "Tobias Soloschenko" <
>>>>>> tobiassoloschenko@googlemail.com> wrote:
>>>>>> 
>>>>>>> And how do I read the ep / dep in the backend if they aren't of Type
>>>>>>> String but a plain javascript object?
>>>>>>> 
>>>>>>> ty for the fast response!
>>>>>>> 
>>>>>>> Tobias
>>>>>>> 
>>>>>>>> Am 15.09.2014 um 14:16 schrieb Martin Grigorov <
>> mgrigorov@apache.org
>>>> :
>>>>>>>> 
>>>>>>>> http://markmail.org/message/fw7cjfo7bzvkjfdu
>>>>>>>> 
>>>>>>>> Martin Grigorov
>>>>>>>> Wicket Training and Consulting
>>>>>>>> https://twitter.com/mtgrigorov
>>>>>>>> 
>>>>>>>> On Mon, Sep 15, 2014 at 3:11 PM, Tobias Soloschenko <
>>>>>>>> tobiassoloschenko@googlemail.com> wrote:
>>>>>>>> 
>>>>>>>>> Hi,
>>>>>>>>> 
>>>>>>>>> is there a way to process post data with the wicket ajax function
>> -
>>> ep
>>>>>>> dep
>>>>>>>>> are only for strings.
>>>>>>>>> 
>>>>>>>>> Kind regards and thanks!
>>>>>>>>> 
>>>>>>>>> Tobias
>>> ---------------------------------------------------------------------
>>>>>>>>> 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
>> 

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


Re: Ajax Post Data

Posted by Martin Grigorov <mg...@apache.org>.
Please file a ticket with attached quickstart application.

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

On Mon, Sep 15, 2014 at 4:44 PM, Tobias Soloschenko <
tobiassoloschenko@googlemail.com> wrote:

> Let me show an example (%s are going to be replaced with the url /
> callbackscript):
>
>     $.ajax({
>         type : 'POST',
>         url : '%s&fileName=' + encodeURIComponent(file.name) +
> '&dropid='+dropid+'&fileid=' + fileid,
>         data : file,
>         contentType : false,
>         processData : false,
>
>         success:function(data, textStatus, jqXHR){
>             var file = this.data
>             // getFinishedUploadClientScript
>             %s
>         }
>     });
>
> With this code I can invoke this on server side and read the data:
> ((HttpServletRequest)
> RequestCycle.get().getRequest().getContainerRequest()).getInputStream()
>
> ---
>
>     Wicket.Ajax.post({'u':'%s&fileName=' + encodeURIComponent(file.name) +
> '&dropid='+dropid+'&fileid=' + fileid, ep:file,sh:function(){
>         // getFinishedUploadClientScript
>         %s;
>     }});
>
> This code is not working with the server side handling of the post content
>
> kind regards
>
> Tobias
>
>
>
>
> 2014-09-15 15:38 GMT+02:00 Tobias Soloschenko <
> tobiassoloschenko@googlemail.com>:
>
> > No - I'm using Wicket.Ajax.post(...) - but if I do a normal $.ajax with
> --
> > type:post, contentType:false, processData:false --I can read the content
> by
> > inputstream I saw that the attrs.ep are passed into the data property but
> > they are encoded which is wrong jQuery.param(data) line 634 of
> > wicket-ajax-jquery. And how can I set the other both options so that I
> can
> > read the content via stream?
> >
> > Kind regards
> >
> > Tobias
> >
> > > Am 15.09.2014 um 15:28 schrieb Martin Grigorov <mg...@apache.org>:
> > >
> > > If you use Wicket.Ajax.post() or Wicket.Ajax.ajax({"m":"post", ....})
> > then
> > > the parameters won't be in the query string.
> > >
> > > wicket-ajax.js puts the parameters to $.ajax({data: HERE, ...}) and
> > > depending on the used 'method' (GET or POST) they will be in the query
> > > string or request body.
> > >
> > > Do you say that with method=post you still see the parameter in the
> query
> > > string ?
> > >
> > > Martin Grigorov
> > > Wicket Training and Consulting
> > > https://twitter.com/mtgrigorov
> > >
> > > On Mon, Sep 15, 2014 at 4:24 PM, Tobias Soloschenko <
> > > tobiassoloschenko@googlemail.com> wrote:
> > >
> > >> But they are add to the query string. This is really bad - maybe it
> > would
> > >> be nice to add a new special attribute which is given directly to the
> > >> jquery's data attribute. It would be possible to get the content via
> > >> inputstream of the httpservletrequest.
> > >>
> > >>
> > >>
> >
> ((HttpServletRequest)RequestCycle.get().getRequest().getContainerRequest()).getInputStream()
> > >>
> > >> kind regards
> > >>
> > >> Tobias
> > >>
> > >>> Am 15.09.2014 um 14:43 schrieb Martin Grigorov <mgrigorov@apache.org
> >:
> > >>>
> > >>> With HTTP you can send either string or binary.
> > >>> You have to convert at the server side
> > >>> On Sep 15, 2014 3:20 PM, "Tobias Soloschenko" <
> > >>> tobiassoloschenko@googlemail.com> wrote:
> > >>>
> > >>>> And how do I read the ep / dep in the backend if they aren't of Type
> > >>>> String but a plain javascript object?
> > >>>>
> > >>>> ty for the fast response!
> > >>>>
> > >>>> Tobias
> > >>>>
> > >>>>> Am 15.09.2014 um 14:16 schrieb Martin Grigorov <
> mgrigorov@apache.org
> > >:
> > >>>>>
> > >>>>> http://markmail.org/message/fw7cjfo7bzvkjfdu
> > >>>>>
> > >>>>> Martin Grigorov
> > >>>>> Wicket Training and Consulting
> > >>>>> https://twitter.com/mtgrigorov
> > >>>>>
> > >>>>> On Mon, Sep 15, 2014 at 3:11 PM, Tobias Soloschenko <
> > >>>>> tobiassoloschenko@googlemail.com> wrote:
> > >>>>>
> > >>>>>> Hi,
> > >>>>>>
> > >>>>>> is there a way to process post data with the wicket ajax function
> -
> > ep
> > >>>> dep
> > >>>>>> are only for strings.
> > >>>>>>
> > >>>>>> Kind regards and thanks!
> > >>>>>>
> > >>>>>> Tobias
> > >>>>>>
> > ---------------------------------------------------------------------
> > >>>>>> 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: Ajax Post Data

Posted by Tobias Soloschenko <to...@googlemail.com>.
Let me show an example (%s are going to be replaced with the url /
callbackscript):

    $.ajax({
        type : 'POST',
        url : '%s&fileName=' + encodeURIComponent(file.name) +
'&dropid='+dropid+'&fileid=' + fileid,
        data : file,
        contentType : false,
        processData : false,

        success:function(data, textStatus, jqXHR){
            var file = this.data
            // getFinishedUploadClientScript
            %s
        }
    });

With this code I can invoke this on server side and read the data:
((HttpServletRequest)
RequestCycle.get().getRequest().getContainerRequest()).getInputStream()

---

    Wicket.Ajax.post({'u':'%s&fileName=' + encodeURIComponent(file.name) +
'&dropid='+dropid+'&fileid=' + fileid, ep:file,sh:function(){
        // getFinishedUploadClientScript
        %s;
    }});

This code is not working with the server side handling of the post content

kind regards

Tobias




2014-09-15 15:38 GMT+02:00 Tobias Soloschenko <
tobiassoloschenko@googlemail.com>:

> No - I'm using Wicket.Ajax.post(...) - but if I do a normal $.ajax with --
> type:post, contentType:false, processData:false --I can read the content by
> inputstream I saw that the attrs.ep are passed into the data property but
> they are encoded which is wrong jQuery.param(data) line 634 of
> wicket-ajax-jquery. And how can I set the other both options so that I can
> read the content via stream?
>
> Kind regards
>
> Tobias
>
> > Am 15.09.2014 um 15:28 schrieb Martin Grigorov <mg...@apache.org>:
> >
> > If you use Wicket.Ajax.post() or Wicket.Ajax.ajax({"m":"post", ....})
> then
> > the parameters won't be in the query string.
> >
> > wicket-ajax.js puts the parameters to $.ajax({data: HERE, ...}) and
> > depending on the used 'method' (GET or POST) they will be in the query
> > string or request body.
> >
> > Do you say that with method=post you still see the parameter in the query
> > string ?
> >
> > Martin Grigorov
> > Wicket Training and Consulting
> > https://twitter.com/mtgrigorov
> >
> > On Mon, Sep 15, 2014 at 4:24 PM, Tobias Soloschenko <
> > tobiassoloschenko@googlemail.com> wrote:
> >
> >> But they are add to the query string. This is really bad - maybe it
> would
> >> be nice to add a new special attribute which is given directly to the
> >> jquery's data attribute. It would be possible to get the content via
> >> inputstream of the httpservletrequest.
> >>
> >>
> >>
> ((HttpServletRequest)RequestCycle.get().getRequest().getContainerRequest()).getInputStream()
> >>
> >> kind regards
> >>
> >> Tobias
> >>
> >>> Am 15.09.2014 um 14:43 schrieb Martin Grigorov <mg...@apache.org>:
> >>>
> >>> With HTTP you can send either string or binary.
> >>> You have to convert at the server side
> >>> On Sep 15, 2014 3:20 PM, "Tobias Soloschenko" <
> >>> tobiassoloschenko@googlemail.com> wrote:
> >>>
> >>>> And how do I read the ep / dep in the backend if they aren't of Type
> >>>> String but a plain javascript object?
> >>>>
> >>>> ty for the fast response!
> >>>>
> >>>> Tobias
> >>>>
> >>>>> Am 15.09.2014 um 14:16 schrieb Martin Grigorov <mgrigorov@apache.org
> >:
> >>>>>
> >>>>> http://markmail.org/message/fw7cjfo7bzvkjfdu
> >>>>>
> >>>>> Martin Grigorov
> >>>>> Wicket Training and Consulting
> >>>>> https://twitter.com/mtgrigorov
> >>>>>
> >>>>> On Mon, Sep 15, 2014 at 3:11 PM, Tobias Soloschenko <
> >>>>> tobiassoloschenko@googlemail.com> wrote:
> >>>>>
> >>>>>> Hi,
> >>>>>>
> >>>>>> is there a way to process post data with the wicket ajax function -
> ep
> >>>> dep
> >>>>>> are only for strings.
> >>>>>>
> >>>>>> Kind regards and thanks!
> >>>>>>
> >>>>>> Tobias
> >>>>>>
> ---------------------------------------------------------------------
> >>>>>> 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: Ajax Post Data

Posted by Tobias Soloschenko <to...@googlemail.com>.
No - I'm using Wicket.Ajax.post(...) - but if I do a normal $.ajax with -- type:post, contentType:false, processData:false --I can read the content by inputstream I saw that the attrs.ep are passed into the data property but they are encoded which is wrong jQuery.param(data) line 634 of wicket-ajax-jquery. And how can I set the other both options so that I can read the content via stream?

Kind regards

Tobias 

> Am 15.09.2014 um 15:28 schrieb Martin Grigorov <mg...@apache.org>:
> 
> If you use Wicket.Ajax.post() or Wicket.Ajax.ajax({"m":"post", ....}) then
> the parameters won't be in the query string.
> 
> wicket-ajax.js puts the parameters to $.ajax({data: HERE, ...}) and
> depending on the used 'method' (GET or POST) they will be in the query
> string or request body.
> 
> Do you say that with method=post you still see the parameter in the query
> string ?
> 
> Martin Grigorov
> Wicket Training and Consulting
> https://twitter.com/mtgrigorov
> 
> On Mon, Sep 15, 2014 at 4:24 PM, Tobias Soloschenko <
> tobiassoloschenko@googlemail.com> wrote:
> 
>> But they are add to the query string. This is really bad - maybe it would
>> be nice to add a new special attribute which is given directly to the
>> jquery's data attribute. It would be possible to get the content via
>> inputstream of the httpservletrequest.
>> 
>> 
>> ((HttpServletRequest)RequestCycle.get().getRequest().getContainerRequest()).getInputStream()
>> 
>> kind regards
>> 
>> Tobias
>> 
>>> Am 15.09.2014 um 14:43 schrieb Martin Grigorov <mg...@apache.org>:
>>> 
>>> With HTTP you can send either string or binary.
>>> You have to convert at the server side
>>> On Sep 15, 2014 3:20 PM, "Tobias Soloschenko" <
>>> tobiassoloschenko@googlemail.com> wrote:
>>> 
>>>> And how do I read the ep / dep in the backend if they aren't of Type
>>>> String but a plain javascript object?
>>>> 
>>>> ty for the fast response!
>>>> 
>>>> Tobias
>>>> 
>>>>> Am 15.09.2014 um 14:16 schrieb Martin Grigorov <mg...@apache.org>:
>>>>> 
>>>>> http://markmail.org/message/fw7cjfo7bzvkjfdu
>>>>> 
>>>>> Martin Grigorov
>>>>> Wicket Training and Consulting
>>>>> https://twitter.com/mtgrigorov
>>>>> 
>>>>> On Mon, Sep 15, 2014 at 3:11 PM, Tobias Soloschenko <
>>>>> tobiassoloschenko@googlemail.com> wrote:
>>>>> 
>>>>>> Hi,
>>>>>> 
>>>>>> is there a way to process post data with the wicket ajax function - ep
>>>> dep
>>>>>> are only for strings.
>>>>>> 
>>>>>> Kind regards and thanks!
>>>>>> 
>>>>>> Tobias
>>>>>> ---------------------------------------------------------------------
>>>>>> 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
>> 
>> 

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


Re: Ajax Post Data

Posted by Martin Grigorov <mg...@apache.org>.
If you use Wicket.Ajax.post() or Wicket.Ajax.ajax({"m":"post", ....}) then
the parameters won't be in the query string.

wicket-ajax.js puts the parameters to $.ajax({data: HERE, ...}) and
depending on the used 'method' (GET or POST) they will be in the query
string or request body.

Do you say that with method=post you still see the parameter in the query
string ?

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

On Mon, Sep 15, 2014 at 4:24 PM, Tobias Soloschenko <
tobiassoloschenko@googlemail.com> wrote:

> But they are add to the query string. This is really bad - maybe it would
> be nice to add a new special attribute which is given directly to the
> jquery's data attribute. It would be possible to get the content via
> inputstream of the httpservletrequest.
>
>
> ((HttpServletRequest)RequestCycle.get().getRequest().getContainerRequest()).getInputStream()
>
> kind regards
>
> Tobias
>
> > Am 15.09.2014 um 14:43 schrieb Martin Grigorov <mg...@apache.org>:
> >
> > With HTTP you can send either string or binary.
> > You have to convert at the server side
> > On Sep 15, 2014 3:20 PM, "Tobias Soloschenko" <
> > tobiassoloschenko@googlemail.com> wrote:
> >
> >> And how do I read the ep / dep in the backend if they aren't of Type
> >> String but a plain javascript object?
> >>
> >> ty for the fast response!
> >>
> >> Tobias
> >>
> >>> Am 15.09.2014 um 14:16 schrieb Martin Grigorov <mg...@apache.org>:
> >>>
> >>> http://markmail.org/message/fw7cjfo7bzvkjfdu
> >>>
> >>> Martin Grigorov
> >>> Wicket Training and Consulting
> >>> https://twitter.com/mtgrigorov
> >>>
> >>> On Mon, Sep 15, 2014 at 3:11 PM, Tobias Soloschenko <
> >>> tobiassoloschenko@googlemail.com> wrote:
> >>>
> >>>> Hi,
> >>>>
> >>>> is there a way to process post data with the wicket ajax function - ep
> >> dep
> >>>> are only for strings.
> >>>>
> >>>> Kind regards and thanks!
> >>>>
> >>>> Tobias
> >>>> ---------------------------------------------------------------------
> >>>> 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: Ajax Post Data

Posted by Tobias Soloschenko <to...@googlemail.com>.
But they are add to the query string. This is really bad - maybe it would be nice to add a new special attribute which is given directly to the jquery's data attribute. It would be possible to get the content via inputstream of the httpservletrequest. 

((HttpServletRequest)RequestCycle.get().getRequest().getContainerRequest()).getInputStream()

kind regards

Tobias

> Am 15.09.2014 um 14:43 schrieb Martin Grigorov <mg...@apache.org>:
> 
> With HTTP you can send either string or binary.
> You have to convert at the server side
> On Sep 15, 2014 3:20 PM, "Tobias Soloschenko" <
> tobiassoloschenko@googlemail.com> wrote:
> 
>> And how do I read the ep / dep in the backend if they aren't of Type
>> String but a plain javascript object?
>> 
>> ty for the fast response!
>> 
>> Tobias
>> 
>>> Am 15.09.2014 um 14:16 schrieb Martin Grigorov <mg...@apache.org>:
>>> 
>>> http://markmail.org/message/fw7cjfo7bzvkjfdu
>>> 
>>> Martin Grigorov
>>> Wicket Training and Consulting
>>> https://twitter.com/mtgrigorov
>>> 
>>> On Mon, Sep 15, 2014 at 3:11 PM, Tobias Soloschenko <
>>> tobiassoloschenko@googlemail.com> wrote:
>>> 
>>>> Hi,
>>>> 
>>>> is there a way to process post data with the wicket ajax function - ep
>> dep
>>>> are only for strings.
>>>> 
>>>> Kind regards and thanks!
>>>> 
>>>> Tobias
>>>> ---------------------------------------------------------------------
>>>> 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: Ajax Post Data

Posted by Martin Grigorov <mg...@apache.org>.
With HTTP you can send either string or binary.
You have to convert at the server side
On Sep 15, 2014 3:20 PM, "Tobias Soloschenko" <
tobiassoloschenko@googlemail.com> wrote:

> And how do I read the ep / dep in the backend if they aren't of Type
> String but a plain javascript object?
>
> ty for the fast response!
>
> Tobias
>
> > Am 15.09.2014 um 14:16 schrieb Martin Grigorov <mg...@apache.org>:
> >
> > http://markmail.org/message/fw7cjfo7bzvkjfdu
> >
> > Martin Grigorov
> > Wicket Training and Consulting
> > https://twitter.com/mtgrigorov
> >
> > On Mon, Sep 15, 2014 at 3:11 PM, Tobias Soloschenko <
> > tobiassoloschenko@googlemail.com> wrote:
> >
> >> Hi,
> >>
> >> is there a way to process post data with the wicket ajax function - ep
> dep
> >> are only for strings.
> >>
> >> Kind regards and thanks!
> >>
> >> Tobias
> >> ---------------------------------------------------------------------
> >> 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: Ajax Post Data

Posted by Tobias Soloschenko <to...@googlemail.com>.
And how do I read the ep / dep in the backend if they aren't of Type String but a plain javascript object?

ty for the fast response!

Tobias 

> Am 15.09.2014 um 14:16 schrieb Martin Grigorov <mg...@apache.org>:
> 
> http://markmail.org/message/fw7cjfo7bzvkjfdu
> 
> Martin Grigorov
> Wicket Training and Consulting
> https://twitter.com/mtgrigorov
> 
> On Mon, Sep 15, 2014 at 3:11 PM, Tobias Soloschenko <
> tobiassoloschenko@googlemail.com> wrote:
> 
>> Hi,
>> 
>> is there a way to process post data with the wicket ajax function - ep dep
>> are only for strings.
>> 
>> Kind regards and thanks!
>> 
>> Tobias
>> ---------------------------------------------------------------------
>> 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: Ajax Post Data

Posted by Martin Grigorov <mg...@apache.org>.
http://markmail.org/message/fw7cjfo7bzvkjfdu

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

On Mon, Sep 15, 2014 at 3:11 PM, Tobias Soloschenko <
tobiassoloschenko@googlemail.com> wrote:

> Hi,
>
> is there a way to process post data with the wicket ajax function - ep dep
> are only for strings.
>
> Kind regards and thanks!
>
> Tobias
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>