You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Michael Mehrle <mi...@ask.com> on 2008/06/25 20:24:20 UTC

Multipart form throws exception

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


RE: Multipart form throws exception

Posted by Michael Mehrle <mi...@ask.com>.
Yes, I knew that - the response type was wrong. Problem was figuring out
which JSON response type would work on all three browsers. We finally
fixed it by setting it to text/plain - we previously had it set to
text/javascript which for some reason worked fine for a while. BTW,
text/html is what we started out with back when and that one never
worked.

It's possible that something has changed in the default mime settings on
the server - probably wasn't wicket that broke that.

Thanks for trying to help though...

Cheers,

Michael

-----Original Message-----
From: Igor Vaynberg [mailto:igor.vaynberg@gmail.com] 
Sent: Wednesday, June 25, 2008 4:09 PM
To: users@wicket.apache.org
Subject: Re: Multipart form throws exception

that is because this is a response to a regular request. i do not see
how that could have ever worked. you cant just write text/javascript
into the browser and expect it to do anything, that is the same as
putting foo.com/bar.js link in the address bar, what happens? you just
view the file.

what you need to do is set the response as text/html and spit out html
that in body onload executes some javascript.

-igor

On Wed, Jun 25, 2008 at 3:02 PM, Michael Mehrle <mi...@ask.com>
wrote:
> Yes, that's true - it IS using a dynamic iFrame. Again, the
*submition*
> process works just fine and I get the data on the backend. What's
> causing the problem is the data being returned and the IE/Safari for
> some reason not liking 'text/javascript' as a content type anymore.
> Something has changed from 1.3.2 to 1.3.3-SNAPSHOT that causes this.
>
> Michael
>
> -----Original Message-----
> From: Igor Vaynberg [mailto:igor.vaynberg@gmail.com]
> Sent: Wednesday, June 25, 2008 2:10 PM
> To: users@wicket.apache.org
> Subject: Re: Multipart form throws exception
>
> doesnt jquery use an iframe? so it is not submitted via ajax...
>
> -igor
>
> On Wed, Jun 25, 2008 at 1:27 PM, Michael Mehrle
<mi...@ask.com>
> wrote:
>> Yeah, remember I build it around jQuery according to that link you
> sent
>> me - not using Wicket for the upload only for bouncing back the
>> response.
>>
>> Thing is that this worked until 1.3.2 and somehow since updating to
>> 1.3.3 it's broken again. The issue seems to be the content type - had
> it
>> working with 'text/javascript' on all three browsers but now it
won't.
>>
>> M.
>>
>> -----Original Message-----
>> From: Igor Vaynberg [mailto:igor.vaynberg@gmail.com]
>> Sent: Wednesday, June 25, 2008 1:22 PM
>> To: users@wicket.apache.org
>> Subject: Re: Multipart form throws exception
>>
>> are you submitting the form via ajax?
>>
>> -igor
>>
>> On Wed, Jun 25, 2008 at 12:09 PM, Michael Mehrle
>> <mi...@ask.com> wrote:
>>> Just ran into the exception again:
>>>
>>> java.lang.IllegalStateException: ServletRequest does not contain
>>> multipart content
>>>        at
>>>
>>
>
org.apache.wicket.protocol.http.servlet.MultipartServletWebRequest.<init
>>>>(MultipartServletWebRequest.java:90)
>>>        at
>>>
>>
>
com.evite.event.web.create.MainImageUpload.receiveUpload(MainImageUpload
>>> .java:66)
>>>        at
>>>
>>
>
com.evite.event.web.create.MainImageUpload.<init>(MainImageUpload.java:3
>>> 8)
>>>
>>>
>>> Sorry, I meant to say 'request'....
>>>
>>> MainImageUpload is what the file uploader points to.
>>>
>>> Michael
>>>
>>> -----Original Message-----
>>> From: Igor Vaynberg [mailto:igor.vaynberg@gmail.com]
>>> Sent: Wednesday, June 25, 2008 11:34 AM
>>> To: users@wicket.apache.org
>>> Subject: Re: Multipart form throws exception
>>>
>>> response not being multipart? wasnt aware there was such a thing...
>>>
>>> -igor
>>>
>>> On Wed, Jun 25, 2008 at 11:24 AM, Michael Mehrle
>>> <mi...@ask.com> wrote:
>>>> 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
>>>>
>>>>
>>>
>>>
---------------------------------------------------------------------
>>> 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
>>
>>
>
> ---------------------------------------------------------------------
> 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: Multipart form throws exception

Posted by Igor Vaynberg <ig...@gmail.com>.
that is because this is a response to a regular request. i do not see
how that could have ever worked. you cant just write text/javascript
into the browser and expect it to do anything, that is the same as
putting foo.com/bar.js link in the address bar, what happens? you just
view the file.

what you need to do is set the response as text/html and spit out html
that in body onload executes some javascript.

-igor

On Wed, Jun 25, 2008 at 3:02 PM, Michael Mehrle <mi...@ask.com> wrote:
> Yes, that's true - it IS using a dynamic iFrame. Again, the *submition*
> process works just fine and I get the data on the backend. What's
> causing the problem is the data being returned and the IE/Safari for
> some reason not liking 'text/javascript' as a content type anymore.
> Something has changed from 1.3.2 to 1.3.3-SNAPSHOT that causes this.
>
> Michael
>
> -----Original Message-----
> From: Igor Vaynberg [mailto:igor.vaynberg@gmail.com]
> Sent: Wednesday, June 25, 2008 2:10 PM
> To: users@wicket.apache.org
> Subject: Re: Multipart form throws exception
>
> doesnt jquery use an iframe? so it is not submitted via ajax...
>
> -igor
>
> On Wed, Jun 25, 2008 at 1:27 PM, Michael Mehrle <mi...@ask.com>
> wrote:
>> Yeah, remember I build it around jQuery according to that link you
> sent
>> me - not using Wicket for the upload only for bouncing back the
>> response.
>>
>> Thing is that this worked until 1.3.2 and somehow since updating to
>> 1.3.3 it's broken again. The issue seems to be the content type - had
> it
>> working with 'text/javascript' on all three browsers but now it won't.
>>
>> M.
>>
>> -----Original Message-----
>> From: Igor Vaynberg [mailto:igor.vaynberg@gmail.com]
>> Sent: Wednesday, June 25, 2008 1:22 PM
>> To: users@wicket.apache.org
>> Subject: Re: Multipart form throws exception
>>
>> are you submitting the form via ajax?
>>
>> -igor
>>
>> On Wed, Jun 25, 2008 at 12:09 PM, Michael Mehrle
>> <mi...@ask.com> wrote:
>>> Just ran into the exception again:
>>>
>>> java.lang.IllegalStateException: ServletRequest does not contain
>>> multipart content
>>>        at
>>>
>>
> org.apache.wicket.protocol.http.servlet.MultipartServletWebRequest.<init
>>>>(MultipartServletWebRequest.java:90)
>>>        at
>>>
>>
> com.evite.event.web.create.MainImageUpload.receiveUpload(MainImageUpload
>>> .java:66)
>>>        at
>>>
>>
> com.evite.event.web.create.MainImageUpload.<init>(MainImageUpload.java:3
>>> 8)
>>>
>>>
>>> Sorry, I meant to say 'request'....
>>>
>>> MainImageUpload is what the file uploader points to.
>>>
>>> Michael
>>>
>>> -----Original Message-----
>>> From: Igor Vaynberg [mailto:igor.vaynberg@gmail.com]
>>> Sent: Wednesday, June 25, 2008 11:34 AM
>>> To: users@wicket.apache.org
>>> Subject: Re: Multipart form throws exception
>>>
>>> response not being multipart? wasnt aware there was such a thing...
>>>
>>> -igor
>>>
>>> On Wed, Jun 25, 2008 at 11:24 AM, Michael Mehrle
>>> <mi...@ask.com> wrote:
>>>> 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
>>>>
>>>>
>>>
>>> ---------------------------------------------------------------------
>>> 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
>>
>>
>
> ---------------------------------------------------------------------
> 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: Multipart form throws exception

Posted by Michael Mehrle <mi...@ask.com>.
Yes, that's true - it IS using a dynamic iFrame. Again, the *submition*
process works just fine and I get the data on the backend. What's
causing the problem is the data being returned and the IE/Safari for
some reason not liking 'text/javascript' as a content type anymore.
Something has changed from 1.3.2 to 1.3.3-SNAPSHOT that causes this.

Michael

-----Original Message-----
From: Igor Vaynberg [mailto:igor.vaynberg@gmail.com] 
Sent: Wednesday, June 25, 2008 2:10 PM
To: users@wicket.apache.org
Subject: Re: Multipart form throws exception

doesnt jquery use an iframe? so it is not submitted via ajax...

-igor

On Wed, Jun 25, 2008 at 1:27 PM, Michael Mehrle <mi...@ask.com>
wrote:
> Yeah, remember I build it around jQuery according to that link you
sent
> me - not using Wicket for the upload only for bouncing back the
> response.
>
> Thing is that this worked until 1.3.2 and somehow since updating to
> 1.3.3 it's broken again. The issue seems to be the content type - had
it
> working with 'text/javascript' on all three browsers but now it won't.
>
> M.
>
> -----Original Message-----
> From: Igor Vaynberg [mailto:igor.vaynberg@gmail.com]
> Sent: Wednesday, June 25, 2008 1:22 PM
> To: users@wicket.apache.org
> Subject: Re: Multipart form throws exception
>
> are you submitting the form via ajax?
>
> -igor
>
> On Wed, Jun 25, 2008 at 12:09 PM, Michael Mehrle
> <mi...@ask.com> wrote:
>> Just ran into the exception again:
>>
>> java.lang.IllegalStateException: ServletRequest does not contain
>> multipart content
>>        at
>>
>
org.apache.wicket.protocol.http.servlet.MultipartServletWebRequest.<init
>>>(MultipartServletWebRequest.java:90)
>>        at
>>
>
com.evite.event.web.create.MainImageUpload.receiveUpload(MainImageUpload
>> .java:66)
>>        at
>>
>
com.evite.event.web.create.MainImageUpload.<init>(MainImageUpload.java:3
>> 8)
>>
>>
>> Sorry, I meant to say 'request'....
>>
>> MainImageUpload is what the file uploader points to.
>>
>> Michael
>>
>> -----Original Message-----
>> From: Igor Vaynberg [mailto:igor.vaynberg@gmail.com]
>> Sent: Wednesday, June 25, 2008 11:34 AM
>> To: users@wicket.apache.org
>> Subject: Re: Multipart form throws exception
>>
>> response not being multipart? wasnt aware there was such a thing...
>>
>> -igor
>>
>> On Wed, Jun 25, 2008 at 11:24 AM, Michael Mehrle
>> <mi...@ask.com> wrote:
>>> 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
>>>
>>>
>>
>> ---------------------------------------------------------------------
>> 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
>
>

---------------------------------------------------------------------
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: Multipart form throws exception

Posted by Igor Vaynberg <ig...@gmail.com>.
doesnt jquery use an iframe? so it is not submitted via ajax...

-igor

On Wed, Jun 25, 2008 at 1:27 PM, Michael Mehrle <mi...@ask.com> wrote:
> Yeah, remember I build it around jQuery according to that link you sent
> me - not using Wicket for the upload only for bouncing back the
> response.
>
> Thing is that this worked until 1.3.2 and somehow since updating to
> 1.3.3 it's broken again. The issue seems to be the content type - had it
> working with 'text/javascript' on all three browsers but now it won't.
>
> M.
>
> -----Original Message-----
> From: Igor Vaynberg [mailto:igor.vaynberg@gmail.com]
> Sent: Wednesday, June 25, 2008 1:22 PM
> To: users@wicket.apache.org
> Subject: Re: Multipart form throws exception
>
> are you submitting the form via ajax?
>
> -igor
>
> On Wed, Jun 25, 2008 at 12:09 PM, Michael Mehrle
> <mi...@ask.com> wrote:
>> Just ran into the exception again:
>>
>> java.lang.IllegalStateException: ServletRequest does not contain
>> multipart content
>>        at
>>
> org.apache.wicket.protocol.http.servlet.MultipartServletWebRequest.<init
>>>(MultipartServletWebRequest.java:90)
>>        at
>>
> com.evite.event.web.create.MainImageUpload.receiveUpload(MainImageUpload
>> .java:66)
>>        at
>>
> com.evite.event.web.create.MainImageUpload.<init>(MainImageUpload.java:3
>> 8)
>>
>>
>> Sorry, I meant to say 'request'....
>>
>> MainImageUpload is what the file uploader points to.
>>
>> Michael
>>
>> -----Original Message-----
>> From: Igor Vaynberg [mailto:igor.vaynberg@gmail.com]
>> Sent: Wednesday, June 25, 2008 11:34 AM
>> To: users@wicket.apache.org
>> Subject: Re: Multipart form throws exception
>>
>> response not being multipart? wasnt aware there was such a thing...
>>
>> -igor
>>
>> On Wed, Jun 25, 2008 at 11:24 AM, Michael Mehrle
>> <mi...@ask.com> wrote:
>>> 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
>>>
>>>
>>
>> ---------------------------------------------------------------------
>> 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
>
>

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


RE: Multipart form throws exception

Posted by Michael Mehrle <mi...@ask.com>.
Yeah, remember I build it around jQuery according to that link you sent
me - not using Wicket for the upload only for bouncing back the
response.

Thing is that this worked until 1.3.2 and somehow since updating to
1.3.3 it's broken again. The issue seems to be the content type - had it
working with 'text/javascript' on all three browsers but now it won't.

M.

-----Original Message-----
From: Igor Vaynberg [mailto:igor.vaynberg@gmail.com] 
Sent: Wednesday, June 25, 2008 1:22 PM
To: users@wicket.apache.org
Subject: Re: Multipart form throws exception

are you submitting the form via ajax?

-igor

On Wed, Jun 25, 2008 at 12:09 PM, Michael Mehrle
<mi...@ask.com> wrote:
> Just ran into the exception again:
>
> java.lang.IllegalStateException: ServletRequest does not contain
> multipart content
>        at
>
org.apache.wicket.protocol.http.servlet.MultipartServletWebRequest.<init
>>(MultipartServletWebRequest.java:90)
>        at
>
com.evite.event.web.create.MainImageUpload.receiveUpload(MainImageUpload
> .java:66)
>        at
>
com.evite.event.web.create.MainImageUpload.<init>(MainImageUpload.java:3
> 8)
>
>
> Sorry, I meant to say 'request'....
>
> MainImageUpload is what the file uploader points to.
>
> Michael
>
> -----Original Message-----
> From: Igor Vaynberg [mailto:igor.vaynberg@gmail.com]
> Sent: Wednesday, June 25, 2008 11:34 AM
> To: users@wicket.apache.org
> Subject: Re: Multipart form throws exception
>
> response not being multipart? wasnt aware there was such a thing...
>
> -igor
>
> On Wed, Jun 25, 2008 at 11:24 AM, Michael Mehrle
> <mi...@ask.com> wrote:
>> 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
>>
>>
>
> ---------------------------------------------------------------------
> 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: Multipart form throws exception

Posted by Igor Vaynberg <ig...@gmail.com>.
are you submitting the form via ajax?

-igor

On Wed, Jun 25, 2008 at 12:09 PM, Michael Mehrle <mi...@ask.com> wrote:
> Just ran into the exception again:
>
> java.lang.IllegalStateException: ServletRequest does not contain
> multipart content
>        at
> org.apache.wicket.protocol.http.servlet.MultipartServletWebRequest.<init
>>(MultipartServletWebRequest.java:90)
>        at
> com.evite.event.web.create.MainImageUpload.receiveUpload(MainImageUpload
> .java:66)
>        at
> com.evite.event.web.create.MainImageUpload.<init>(MainImageUpload.java:3
> 8)
>
>
> Sorry, I meant to say 'request'....
>
> MainImageUpload is what the file uploader points to.
>
> Michael
>
> -----Original Message-----
> From: Igor Vaynberg [mailto:igor.vaynberg@gmail.com]
> Sent: Wednesday, June 25, 2008 11:34 AM
> To: users@wicket.apache.org
> Subject: Re: Multipart form throws exception
>
> response not being multipart? wasnt aware there was such a thing...
>
> -igor
>
> On Wed, Jun 25, 2008 at 11:24 AM, Michael Mehrle
> <mi...@ask.com> wrote:
>> 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
>>
>>
>
> ---------------------------------------------------------------------
> 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: Multipart form throws exception

Posted by Michael Mehrle <mi...@ask.com>.
Just ran into the exception again:

java.lang.IllegalStateException: ServletRequest does not contain
multipart content
	at
org.apache.wicket.protocol.http.servlet.MultipartServletWebRequest.<init
>(MultipartServletWebRequest.java:90)
	at
com.evite.event.web.create.MainImageUpload.receiveUpload(MainImageUpload
.java:66)
	at
com.evite.event.web.create.MainImageUpload.<init>(MainImageUpload.java:3
8)


Sorry, I meant to say 'request'....

MainImageUpload is what the file uploader points to.

Michael

-----Original Message-----
From: Igor Vaynberg [mailto:igor.vaynberg@gmail.com] 
Sent: Wednesday, June 25, 2008 11:34 AM
To: users@wicket.apache.org
Subject: Re: Multipart form throws exception

response not being multipart? wasnt aware there was such a thing...

-igor

On Wed, Jun 25, 2008 at 11:24 AM, Michael Mehrle
<mi...@ask.com> wrote:
> 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
>
>

---------------------------------------------------------------------
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: Multipart form throws exception

Posted by Igor Vaynberg <ig...@gmail.com>.
response not being multipart? wasnt aware there was such a thing...

-igor

On Wed, Jun 25, 2008 at 11:24 AM, Michael Mehrle <mi...@ask.com> wrote:
> 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
>
>

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