Hi,

Yes, there is a workaround. Sorry about that!

See http://wicketinaction.com/2012/11/uploading-files-to-wicket-iresource/

ServletWebRequest webRequest = (ServletWebRequest) attributes.getRequest();
MultipartServletWebRequest multiPartRequest =
webRequest.newMultipartWebRequest(getMaxSize(), "ignored");
// Note: since Wicket 6.18.0 you will need to call
"multiPartRequest.parseFileParts();" additionally here
Map<String, List<FileItem>> files = multiPartRequest.getFiles();

Wicket does this for you for normal form submit, but you have to call
multiPartRequest.parseFileParts(); explicitly if you do this manually.
I've found this problem while testing the proposed release (
http://markmail.org/message/uu4u7xgqioqdsay5) but didn't vote negatively
because I think there are not many apps using it and the workaround is easy.

Sorry again!


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

On Thu, Nov 13, 2014 at 10:52 PM, Brad Grier <[email protected]>
wrote:

> We have some client side js that constructs a new FormData() object, adds
> fields to it including a file and posts it to a Wicket behavior using a
> $.ajax() call. In the behavior's onRequest(), we get the fields and file
> from the MultipartServletWebRequest object. This worked perfectly until
> 6.18. Now the behavior gets called but no fields from the constructed
> DataForm object are in the requestParameters and the getFiles() call is
> empty.
>
> Any thoughts or ideas for a workaround?
>
> --
> View this message in context:
> http://apache-wicket.1842946.n4.nabble.com/JQuery-ajax-Call-Breaks-In-6-18-tp4668393.html
> Sent from the Users forum mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
>
>

Reply via email to