I'm on Wicket 1.3.3 and am experiencing problems with multipart content
on Safari and IE. The backend page receiving the image processes it just
fine and returns a response like this:

 

RequestCycle.get().setRequestTarget(new IRequestTarget() {

                                    public void detach(RequestCycle
requestCycle) {

            }

                                    public void respond(RequestCycle
requestCycle) {

                                                // formulate the JSON
response 

                                                StringBuffer response =
new StringBuffer("{\n");

                if (StringUtils.isNotEmpty(error)) {

                        response.append("\"error\":
\"").append(getString(error)).append("\"");

                } else {

                        response.append("\"msg\":
\"").append(getString("successfulFileUploadNotification")).append("\",\n
");

                        response.append("\"photoId\":
\"").append(photo.getId()).append("\",\n");

                        response.append("\"uri\":
\"").append(photoService.getPhotoSrc(photo)).append("\"");

                }

                response.append("\n}");

                                                Response rep =
requestCycle.getResponse();

 
rep.setContentType("text/javascript");

                        rep.write(response);

            }

                        });

 

As you can see I'm bouncing a JSON response back, which is received and
handled on my front end. It works in Firefox but fails in Safari and IE
with an error message which I would love to post but I'm not getting
every time. I do remember however that it complained about the response
not being 'multipart'.

 

There is a similar bug report that was posted a while ago and claimed
this to be fixed in 1.3.3.

 

http://www.nabble.com/Multipart-form-with-nested-ajaxform-throws-excepti
on-in-1.3.1-td15975693.html

 

Any suggestions would be welcome.

 

Thanks!

 

Michael

Reply via email to