I'm currently using Wicket and a jQuery plugin to crop picture ("croppic") and it need to request with ajax my back-end to crop the picture. The data are sent in a multipart format.
My Wicket back-end is an Ajax behavior with the "onRequest" method and I don't know how to retrieve the multipart data.
@Override
public void onRequest() {
String json = "{}";
boolean hasError = false;
RequestCycle cycle = getComponent().getRequestCycle();
IRequestParameters parameters = cycle.getRequest().getPostParameters();
This code only access to classic POST variables but cannot used to multipart form data (values are empty).
Do you know how to proceed for that?
PS: this thread is helpful but not understandable for me : Wicket 6 - Capturing HttpServletRequest parameters in Multipart form?
The body payload:
------WebKitFormBoundarykpVsQAYFGJywlAZd
Content-Disposition: form-data; name="imgUrl"
https://scontent.xx.fbcdn.net/hprofile-xpf1/t31.0- 1/c0.0.1536.1536/13055008_225242101175595_5770204993752392511_o.jpg
------WebKitFormBoundarykpVsQAYFGJywlAZd
Content-Disposition: form-data; name="imgInitW"
1536
------WebKitFormBoundarykpVsQAYFGJywlAZd
Content-Disposition: form-data; name="imgInitH"
1536
------WebKitFormBoundarykpVsQAYFGJywlAZd
Content-Disposition: form-data; name="imgW"
500
------WebKitFormBoundarykpVsQAYFGJywlAZd
Content-Disposition: form-data; name="imgH"
500
------WebKitFormBoundarykpVsQAYFGJywlAZd
Content-Disposition: form-data; name="imgY1"
etc...