You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by "Corbin, James" <jc...@iqnavigator.com> on 2010/03/09 22:26:06 UTC

Nested Forms and Multipart Fileupload Issue

This issue seems to pop up in our environment from time to time and trying to figure out how to fix it once and for all.

We have a page with a form that pops up modal window with a form specified as well.

When we try to submit, we get the following exception:

java.lang.IllegalStateException: ServletRequest does not contain multipart content. One possible solution is to explicitly call Form.setMultipart(true), Wicket tries its best to auto-detect multipart forms but there are certain situation where it cannot.
at org.apache.wicket.protocol.http.servlet.MultipartServletWebRequest.<init>(MultipartServletWebRequest.java:113)
at org.apache.wicket.protocol.http.servlet.MultipartServletWebRequest.<init>(MultipartServletWebRequest.java:83)
at org.apache.wicket.protocol.http.servlet.ServletWebRequest.newMultipartWebRequest(ServletWebRequest.java:500)
at org.apache.wicket.markup.html.form.Form.handleMultiPart(Form.java:1668)
at org.apache.wicket.markup.html.form.Form.onFormSubmitted(Form.java:862)
at org.apache.wicket.ajax.form.AjaxFormSubmitBehavior.onEvent(AjaxFormSubmitBehavior.java:135)
at org.apache.wicket.ajax.AjaxEventBehavior.respond(AjaxEventBehavior.java:177)
...

Setting Form.setMultipart(true) on either form has no affect.

We are running Wicket Version 1.4.7.

Is there a fix for this issue?

Is this JIRA Issue related??? https://issues.apache.org/jira/browse/WICKET-2749



RE: Nested Forms and Multipart Fileupload Issue

Posted by "Corbin, James" <jc...@iqnavigator.com>.
Yeah, some feedback from the Wicket Contributors on this issue would be greatly appreciated.

-----Original Message-----
From: Michał Letyński [mailto:mletynski@consol.pl] 
Sent: Wednesday, March 10, 2010 7:52 AM
To: users@wicket.apache.org
Subject: Re: Nested Forms and Multipart Fileupload Issue

Is there a wicket version where it works ? I tried  with 1.4.6 and 1.4.7 
but i get the same error which James got.
My use case : I'm trying to submit a form via ajax to upload a file  
inside modal window.
After debug:
FileUploadBase.isMultipartContent get false because

if (contentType.toLowerCase().startsWith(MULTIPART))   - contentType = 
application/x-www-form-urlencoded
 
James Carman pisze:
> You're trying to submit a form via ajax to upload a file?
>
> On Tue, Mar 9, 2010 at 4:26 PM, Corbin, James <jc...@iqnavigator.com> wrote:
>   
>> This issue seems to pop up in our environment from time to time and trying to figure out how to fix it once and for all.
>>
>> We have a page with a form that pops up modal window with a form specified as well.
>>
>> When we try to submit, we get the following exception:
>>
>> java.lang.IllegalStateException: ServletRequest does not contain multipart content. One possible solution is to explicitly call Form.setMultipart(true), Wicket tries its best to auto-detect multipart forms but there are certain situation where it cannot.
>> at org.apache.wicket.protocol.http.servlet.MultipartServletWebRequest.<init>(MultipartServletWebRequest.java:113)
>> at org.apache.wicket.protocol.http.servlet.MultipartServletWebRequest.<init>(MultipartServletWebRequest.java:83)
>> at org.apache.wicket.protocol.http.servlet.ServletWebRequest.newMultipartWebRequest(ServletWebRequest.java:500)
>> at org.apache.wicket.markup.html.form.Form.handleMultiPart(Form.java:1668)
>> at org.apache.wicket.markup.html.form.Form.onFormSubmitted(Form.java:862)
>> at org.apache.wicket.ajax.form.AjaxFormSubmitBehavior.onEvent(AjaxFormSubmitBehavior.java:135)
>> at org.apache.wicket.ajax.AjaxEventBehavior.respond(AjaxEventBehavior.java:177)
>> ...
>>
>> Setting Form.setMultipart(true) on either form has no affect.
>>
>> We are running Wicket Version 1.4.7.
>>
>> Is there a fix for this issue?
>>
>> Is this JIRA Issue related??? https://issues.apache.org/jira/browse/WICKET-2749
>>
>>
>>
>>     
>
> ---------------------------------------------------------------------
> 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: Nested Forms and Multipart Fileupload Issue

Posted by Alexander Morozov <al...@gmail.com>.
https://issues.apache.org/jira/browse/WICKET-3555

Thanks


Martin Grigorov-4 wrote:
> 
> Create a ticket please.
> And attach the quickstart.
> 
> On Wed, Mar 23, 2011 at 12:19 PM, Stijn Maller
> &lt;stijn.maller@gmail.com&gt;wrote:
> 
> &gt; Alexander,
> &gt;
> &gt; I'm facing the same issue and I'm convinced it is a bug.
> &gt;
> &gt; When a FileUploadField in a nested form causes an error, then:
> &gt;
> &gt;   - The ErrorMessage is registered on the outer form (instead of the
> inner
> &gt;   form)
> &gt;   - The outer form's onError method is called (instead of that of the
> inner
> &gt;   form)
> &gt;   - The outer form is considered not valid
> &gt;
> &gt; This goes against https://cwiki.apache.org/WICKET/nested-forms.html
> and
> &gt; it's
> &gt; also the opposite of what happens when the FileUploadField is
> submitted
> &gt; without error. (Only the inner form's onSubmit is called)
> &gt;
> &gt; As a sidenote, I also find it a bit strange that:
> &gt; 1) the FileUploadField itself is considered valid and the error
> message is
> &gt; not registered to this component.
> &gt; 2) the onSubmit method of the AjaxButton is called instead of the
> onError
> &gt; method.
> &gt;
> &gt; Sorry, but I have not found a workaround yet.
> &gt;
> &gt; Kind regards,
> &gt; Stijn
> &gt;
> &gt;
> &gt; On 17 January 2011 17:59, Alexander Morozov
> &gt; &lt;alexander.v.morozov@gmail.com&gt;wrote:
> &gt;
> &gt; &gt;
> &gt; &gt; Hi,
> &gt; &gt;
> &gt; &gt; I have faced with another problem, related to nested forms and
> &gt; &gt; FileUploadField (wicket-1.4.15).
> &gt; &gt; The nested form have FileUploadField instance and defined
> &gt; setMaxSize(100K).
> &gt; &gt; In case of submitting thru Ajax file more than 100K, hasError()
> on the
> &gt; &gt; nested form return false. But I expect here 'true' - because of
> &gt; setMaxSize
> &gt; &gt; constraint violation. Is this expected behavior ?
> &gt; &gt;
> &gt; &gt; Quickstart is attached.
> &gt; &gt;
> &gt;
> http://apache-wicket.1842946.n4.nabble.com/file/n3221235/modalproject2.zip
> &gt; &gt; modalproject2.zip
> &gt; &gt;
> &gt; &gt; Thanks
> &gt; &gt;
> &gt; &gt; --
> &gt; &gt; View this message in context:
> &gt; &gt;
> &gt;
> http://apache-wicket.1842946.n4.nabble.com/Nested-Forms-and-Multipart-Fileupload-Issue-tp1844365p3221235.html
> &gt; &gt; Sent from the Users forum mailing list archive at Nabble.com.
> &gt; &gt;
> &gt; &gt;
> ---------------------------------------------------------------------
> &gt; &gt; To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> &gt; &gt; For additional commands, e-mail: users-help@wicket.apache.org
> &gt; &gt;
> &gt; &gt;
> &gt;
> 
> 
> 
> -- 
> Martin Grigorov
> jWeekend
> Training, Consulting, Development
> http://jWeekend.com &lt;http://jweekend.com/&gt;
> 


-----
--
http://www.linkedin.com/in/amorozov
--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/Nested-Forms-and-Multipart-Fileupload-Issue-tp1844365p3402637.html
Sent from the Users forum mailing list archive at Nabble.com.

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


Re: Nested Forms and Multipart Fileupload Issue

Posted by Martin Grigorov <mg...@apache.org>.
Create a ticket please.
And attach the quickstart.

On Wed, Mar 23, 2011 at 12:19 PM, Stijn Maller <st...@gmail.com>wrote:

> Alexander,
>
> I'm facing the same issue and I'm convinced it is a bug.
>
> When a FileUploadField in a nested form causes an error, then:
>
>   - The ErrorMessage is registered on the outer form (instead of the inner
>   form)
>   - The outer form's onError method is called (instead of that of the inner
>   form)
>   - The outer form is considered not valid
>
> This goes against https://cwiki.apache.org/WICKET/nested-forms.html and
> it's
> also the opposite of what happens when the FileUploadField is submitted
> without error. (Only the inner form's onSubmit is called)
>
> As a sidenote, I also find it a bit strange that:
> 1) the FileUploadField itself is considered valid and the error message is
> not registered to this component.
> 2) the onSubmit method of the AjaxButton is called instead of the onError
> method.
>
> Sorry, but I have not found a workaround yet.
>
> Kind regards,
> Stijn
>
>
> On 17 January 2011 17:59, Alexander Morozov
> <al...@gmail.com>wrote:
>
> >
> > Hi,
> >
> > I have faced with another problem, related to nested forms and
> > FileUploadField (wicket-1.4.15).
> > The nested form have FileUploadField instance and defined
> setMaxSize(100K).
> > In case of submitting thru Ajax file more than 100K, hasError() on the
> > nested form return false. But I expect here 'true' - because of
> setMaxSize
> > constraint violation. Is this expected behavior ?
> >
> > Quickstart is attached.
> >
> http://apache-wicket.1842946.n4.nabble.com/file/n3221235/modalproject2.zip
> > modalproject2.zip
> >
> > Thanks
> >
> > --
> > View this message in context:
> >
> http://apache-wicket.1842946.n4.nabble.com/Nested-Forms-and-Multipart-Fileupload-Issue-tp1844365p3221235.html
> > Sent from the Users forum mailing list archive at Nabble.com.
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> > For additional commands, e-mail: users-help@wicket.apache.org
> >
> >
>



-- 
Martin Grigorov
jWeekend
Training, Consulting, Development
http://jWeekend.com <http://jweekend.com/>

Re: Nested Forms and Multipart Fileupload Issue

Posted by Stijn Maller <st...@gmail.com>.
Alexander,

I'm facing the same issue and I'm convinced it is a bug.

When a FileUploadField in a nested form causes an error, then:

   - The ErrorMessage is registered on the outer form (instead of the inner
   form)
   - The outer form's onError method is called (instead of that of the inner
   form)
   - The outer form is considered not valid

This goes against https://cwiki.apache.org/WICKET/nested-forms.html and it's
also the opposite of what happens when the FileUploadField is submitted
without error. (Only the inner form's onSubmit is called)

As a sidenote, I also find it a bit strange that:
1) the FileUploadField itself is considered valid and the error message is
not registered to this component.
2) the onSubmit method of the AjaxButton is called instead of the onError
method.

Sorry, but I have not found a workaround yet.

Kind regards,
Stijn


On 17 January 2011 17:59, Alexander Morozov
<al...@gmail.com>wrote:

>
> Hi,
>
> I have faced with another problem, related to nested forms and
> FileUploadField (wicket-1.4.15).
> The nested form have FileUploadField instance and defined setMaxSize(100K).
> In case of submitting thru Ajax file more than 100K, hasError() on the
> nested form return false. But I expect here 'true' - because of setMaxSize
> constraint violation. Is this expected behavior ?
>
> Quickstart is attached.
> http://apache-wicket.1842946.n4.nabble.com/file/n3221235/modalproject2.zip
> modalproject2.zip
>
> Thanks
>
> --
> View this message in context:
> http://apache-wicket.1842946.n4.nabble.com/Nested-Forms-and-Multipart-Fileupload-Issue-tp1844365p3221235.html
> Sent from the Users forum mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>

Re: Nested Forms and Multipart Fileupload Issue

Posted by Alexander Morozov <al...@gmail.com>.
Hi,

I have faced with another problem, related to nested forms and
FileUploadField (wicket-1.4.15).
The nested form have FileUploadField instance and defined setMaxSize(100K).
In case of submitting thru Ajax file more than 100K, hasError() on the
nested form return false. But I expect here 'true' - because of setMaxSize
constraint violation. Is this expected behavior ?

Quickstart is attached. 
http://apache-wicket.1842946.n4.nabble.com/file/n3221235/modalproject2.zip
modalproject2.zip 

Thanks

-- 
View this message in context: http://apache-wicket.1842946.n4.nabble.com/Nested-Forms-and-Multipart-Fileupload-Issue-tp1844365p3221235.html
Sent from the Users forum mailing list archive at Nabble.com.

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


Re: Nested Forms and Multipart Fileupload Issue

Posted by theFatEx <ch...@blfd.bayern.de>.
Hi,

WICKET-2779 seems to be related to modal windows with upload and ajax 
but jcorbins original post was about a nested form in a modal window within
a multipart form.

Are both issues fixed or does the problem from jcorbins first post persist?

thanks
Christian


 
-- 
View this message in context: http://apache-wicket.1842946.n4.nabble.com/Nested-Forms-and-Multipart-Fileupload-Issue-tp1844365p3159359.html
Sent from the Users forum mailing list archive at Nabble.com.

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


Re: Nested Forms and Multipart Fileupload Issue

Posted by Michał Letyński <ml...@consol.pl>.
Jirra issue with quickstart added: 
https://issues.apache.org/jira/browse/WICKET-2779

Michał Letyński pisze:
> Did you add a jira issue James ? If not i can do it. Its a showstopper 
> for me.
>
> Ilja Pavkovic pisze:
>> Hi,
>>
>>  
>>>> Hmmm...I thought the Wicket Team already implemented something 
>>>> similar to
>>>> this into the framework some time ago.
>>>>       
>> Perhaps you should provide a quickstart and perhaps put it in a jira 
>> ticket?
>>
>> Best Regards,
>>     Ilja Pavkovic
>>
>>   
>
>

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


Re: Nested Forms and Multipart Fileupload Issue

Posted by Michał Letyński <ml...@consol.pl>.
Did you add a jira issue James ? If not i can do it. Its a showstopper 
for me.

Ilja Pavkovic pisze:
> Hi,
>
>   
>>> Hmmm...I thought the Wicket Team already implemented something similar to
>>> this into the framework some time ago.
>>>       
> Perhaps you should provide a quickstart and perhaps put it in a jira ticket?
>
> Best Regards,
> 	Ilja Pavkovic
>
>   


-- 
Michał Letyński
ConSol* Consulting & Solutions Software Poland Sp. z o.o.
ul. Piastowska 44c, 30-070 Krakow
mail: mikel@consol.pl
tel: +48 609 266 753 


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


Re: Nested Forms and Multipart Fileupload Issue

Posted by Ilja Pavkovic <il...@binaere-bauten.de>.
Hi,

> > Hmmm...I thought the Wicket Team already implemented something similar to
> > this into the framework some time ago.
Perhaps you should provide a quickstart and perhaps put it in a jira ticket?

Best Regards,
	Ilja Pavkovic

-- 
binaere bauten gmbh · tempelhofer ufer 1a · 10961 berlin

   +49 · 171 · 9342 465

Handelsregister: HRB 115854 - Amtsgericht Charlottenburg
Geschäftsführer: Dipl.-Inform. Ilja Pavkovic, Dipl.-Inform. Jost Becker

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


Re: Nested Forms and Multipart Fileupload Issue

Posted by Jeremy Thomerson <je...@wickettraining.com>.
No - there is support for submitting forms via ajax that contain file upload
fields - in the core of Wicket.  It was added near the beginning of 1.4
IIRC.  However, I'm not sure about this particular use case.  It sounds like
a bug.

Could you please create a quickstart, attach to a JIRA, and post the JIRA
link back here?  Then we can take a look.

Thanks

--
Jeremy Thomerson
http://www.wickettraining.com



On Wed, Mar 10, 2010 at 12:21 PM, James Carman <jcarman@carmanconsulting.com
> wrote:

> Perhaps it's in Wicket-stuff?  I don't know.
>
> On Wed, Mar 10, 2010 at 1:19 PM, Corbin, James <jc...@iqnavigator.com>
> wrote:
> > Hmmm...I thought the Wicket Team already implemented something similar to
> this into the framework some time ago.
> >
> > -----Original Message-----
> > From: James Carman [mailto:jcarman@carmanconsulting.com]
> > Sent: Wednesday, March 10, 2010 11:15 AM
> > To: users@wicket.apache.org
> > Subject: Re: Nested Forms and Multipart Fileupload Issue
> >
> > Someone at work had some luck with this approach from what I
> understand...
> >
> >
> http://www.dooriented.com/blog/2008/04/23/wicket-ajax-like-file-upload-on-a-modal-window/
> >
> >
> > 2010/3/10 Michał Letyński <ml...@consol.pl>:
> >> Is there a wicket version where it works ? I tried  with 1.4.6 and 1.4.7
> but
> >> i get the same error which James got.
> >> My use case : I'm trying to submit a form via ajax to upload a file
>  inside
> >> modal window.
> >> After debug:
> >> FileUploadBase.isMultipartContent get false because
> >>
> >> if (contentType.toLowerCase().startsWith(MULTIPART))   - contentType =
> >> application/x-www-form-urlencoded
> >>
> >> James Carman pisze:
> >>>
> >>> You're trying to submit a form via ajax to upload a file?
> >>>
> >>> On Tue, Mar 9, 2010 at 4:26 PM, Corbin, James <jcorbin@iqnavigator.com
> >
> >>> wrote:
> >>>
> >>>>
> >>>> This issue seems to pop up in our environment from time to time and
> >>>> trying to figure out how to fix it once and for all.
> >>>>
> >>>> We have a page with a form that pops up modal window with a form
> >>>> specified as well.
> >>>>
> >>>> When we try to submit, we get the following exception:
> >>>>
> >>>> java.lang.IllegalStateException: ServletRequest does not contain
> >>>> multipart content. One possible solution is to explicitly call
> >>>> Form.setMultipart(true), Wicket tries its best to auto-detect
> multipart
> >>>> forms but there are certain situation where it cannot.
> >>>> at
> >>>>
> org.apache.wicket.protocol.http.servlet.MultipartServletWebRequest.<init>(MultipartServletWebRequest.java:113)
> >>>> at
> >>>>
> org.apache.wicket.protocol.http.servlet.MultipartServletWebRequest.<init>(MultipartServletWebRequest.java:83)
> >>>> at
> >>>>
> org.apache.wicket.protocol.http.servlet.ServletWebRequest.newMultipartWebRequest(ServletWebRequest.java:500)
> >>>> at
> >>>>
> org.apache.wicket.markup.html.form.Form.handleMultiPart(Form.java:1668)
> >>>> at
> org.apache.wicket.markup.html.form.Form.onFormSubmitted(Form.java:862)
> >>>> at
> >>>>
> org.apache.wicket.ajax.form.AjaxFormSubmitBehavior.onEvent(AjaxFormSubmitBehavior.java:135)
> >>>> at
> >>>>
> org.apache.wicket.ajax.AjaxEventBehavior.respond(AjaxEventBehavior.java:177)
> >>>> ...
> >>>>
> >>>> Setting Form.setMultipart(true) on either form has no affect.
> >>>>
> >>>> We are running Wicket Version 1.4.7.
> >>>>
> >>>> Is there a fix for this issue?
> >>>>
> >>>> Is this JIRA Issue related???
> >>>> https://issues.apache.org/jira/browse/WICKET-2749
> >>>>
> >>>>
> >>>>
> >>>>
> >>>
> >>> ---------------------------------------------------------------------
> >>> 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: Nested Forms and Multipart Fileupload Issue

Posted by James Carman <jc...@carmanconsulting.com>.
Perhaps it's in Wicket-stuff?  I don't know.

On Wed, Mar 10, 2010 at 1:19 PM, Corbin, James <jc...@iqnavigator.com> wrote:
> Hmmm...I thought the Wicket Team already implemented something similar to this into the framework some time ago.
>
> -----Original Message-----
> From: James Carman [mailto:jcarman@carmanconsulting.com]
> Sent: Wednesday, March 10, 2010 11:15 AM
> To: users@wicket.apache.org
> Subject: Re: Nested Forms and Multipart Fileupload Issue
>
> Someone at work had some luck with this approach from what I understand...
>
> http://www.dooriented.com/blog/2008/04/23/wicket-ajax-like-file-upload-on-a-modal-window/
>
>
> 2010/3/10 Michał Letyński <ml...@consol.pl>:
>> Is there a wicket version where it works ? I tried  with 1.4.6 and 1.4.7 but
>> i get the same error which James got.
>> My use case : I'm trying to submit a form via ajax to upload a file  inside
>> modal window.
>> After debug:
>> FileUploadBase.isMultipartContent get false because
>>
>> if (contentType.toLowerCase().startsWith(MULTIPART))   - contentType =
>> application/x-www-form-urlencoded
>>
>> James Carman pisze:
>>>
>>> You're trying to submit a form via ajax to upload a file?
>>>
>>> On Tue, Mar 9, 2010 at 4:26 PM, Corbin, James <jc...@iqnavigator.com>
>>> wrote:
>>>
>>>>
>>>> This issue seems to pop up in our environment from time to time and
>>>> trying to figure out how to fix it once and for all.
>>>>
>>>> We have a page with a form that pops up modal window with a form
>>>> specified as well.
>>>>
>>>> When we try to submit, we get the following exception:
>>>>
>>>> java.lang.IllegalStateException: ServletRequest does not contain
>>>> multipart content. One possible solution is to explicitly call
>>>> Form.setMultipart(true), Wicket tries its best to auto-detect multipart
>>>> forms but there are certain situation where it cannot.
>>>> at
>>>> org.apache.wicket.protocol.http.servlet.MultipartServletWebRequest.<init>(MultipartServletWebRequest.java:113)
>>>> at
>>>> org.apache.wicket.protocol.http.servlet.MultipartServletWebRequest.<init>(MultipartServletWebRequest.java:83)
>>>> at
>>>> org.apache.wicket.protocol.http.servlet.ServletWebRequest.newMultipartWebRequest(ServletWebRequest.java:500)
>>>> at
>>>> org.apache.wicket.markup.html.form.Form.handleMultiPart(Form.java:1668)
>>>> at org.apache.wicket.markup.html.form.Form.onFormSubmitted(Form.java:862)
>>>> at
>>>> org.apache.wicket.ajax.form.AjaxFormSubmitBehavior.onEvent(AjaxFormSubmitBehavior.java:135)
>>>> at
>>>> org.apache.wicket.ajax.AjaxEventBehavior.respond(AjaxEventBehavior.java:177)
>>>> ...
>>>>
>>>> Setting Form.setMultipart(true) on either form has no affect.
>>>>
>>>> We are running Wicket Version 1.4.7.
>>>>
>>>> Is there a fix for this issue?
>>>>
>>>> Is this JIRA Issue related???
>>>> https://issues.apache.org/jira/browse/WICKET-2749
>>>>
>>>>
>>>>
>>>>
>>>
>>> ---------------------------------------------------------------------
>>> 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: Nested Forms and Multipart Fileupload Issue

Posted by "Corbin, James" <jc...@iqnavigator.com>.
Hmmm...I thought the Wicket Team already implemented something similar to this into the framework some time ago.

-----Original Message-----
From: James Carman [mailto:jcarman@carmanconsulting.com] 
Sent: Wednesday, March 10, 2010 11:15 AM
To: users@wicket.apache.org
Subject: Re: Nested Forms and Multipart Fileupload Issue

Someone at work had some luck with this approach from what I understand...

http://www.dooriented.com/blog/2008/04/23/wicket-ajax-like-file-upload-on-a-modal-window/


2010/3/10 Michał Letyński <ml...@consol.pl>:
> Is there a wicket version where it works ? I tried  with 1.4.6 and 1.4.7 but
> i get the same error which James got.
> My use case : I'm trying to submit a form via ajax to upload a file  inside
> modal window.
> After debug:
> FileUploadBase.isMultipartContent get false because
>
> if (contentType.toLowerCase().startsWith(MULTIPART))   - contentType =
> application/x-www-form-urlencoded
>
> James Carman pisze:
>>
>> You're trying to submit a form via ajax to upload a file?
>>
>> On Tue, Mar 9, 2010 at 4:26 PM, Corbin, James <jc...@iqnavigator.com>
>> wrote:
>>
>>>
>>> This issue seems to pop up in our environment from time to time and
>>> trying to figure out how to fix it once and for all.
>>>
>>> We have a page with a form that pops up modal window with a form
>>> specified as well.
>>>
>>> When we try to submit, we get the following exception:
>>>
>>> java.lang.IllegalStateException: ServletRequest does not contain
>>> multipart content. One possible solution is to explicitly call
>>> Form.setMultipart(true), Wicket tries its best to auto-detect multipart
>>> forms but there are certain situation where it cannot.
>>> at
>>> org.apache.wicket.protocol.http.servlet.MultipartServletWebRequest.<init>(MultipartServletWebRequest.java:113)
>>> at
>>> org.apache.wicket.protocol.http.servlet.MultipartServletWebRequest.<init>(MultipartServletWebRequest.java:83)
>>> at
>>> org.apache.wicket.protocol.http.servlet.ServletWebRequest.newMultipartWebRequest(ServletWebRequest.java:500)
>>> at
>>> org.apache.wicket.markup.html.form.Form.handleMultiPart(Form.java:1668)
>>> at org.apache.wicket.markup.html.form.Form.onFormSubmitted(Form.java:862)
>>> at
>>> org.apache.wicket.ajax.form.AjaxFormSubmitBehavior.onEvent(AjaxFormSubmitBehavior.java:135)
>>> at
>>> org.apache.wicket.ajax.AjaxEventBehavior.respond(AjaxEventBehavior.java:177)
>>> ...
>>>
>>> Setting Form.setMultipart(true) on either form has no affect.
>>>
>>> We are running Wicket Version 1.4.7.
>>>
>>> Is there a fix for this issue?
>>>
>>> Is this JIRA Issue related???
>>> https://issues.apache.org/jira/browse/WICKET-2749
>>>
>>>
>>>
>>>
>>
>> ---------------------------------------------------------------------
>> 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: Nested Forms and Multipart Fileupload Issue

Posted by James Carman <jc...@carmanconsulting.com>.
Someone at work had some luck with this approach from what I understand...

http://www.dooriented.com/blog/2008/04/23/wicket-ajax-like-file-upload-on-a-modal-window/


2010/3/10 Michał Letyński <ml...@consol.pl>:
> Is there a wicket version where it works ? I tried  with 1.4.6 and 1.4.7 but
> i get the same error which James got.
> My use case : I'm trying to submit a form via ajax to upload a file  inside
> modal window.
> After debug:
> FileUploadBase.isMultipartContent get false because
>
> if (contentType.toLowerCase().startsWith(MULTIPART))   - contentType =
> application/x-www-form-urlencoded
>
> James Carman pisze:
>>
>> You're trying to submit a form via ajax to upload a file?
>>
>> On Tue, Mar 9, 2010 at 4:26 PM, Corbin, James <jc...@iqnavigator.com>
>> wrote:
>>
>>>
>>> This issue seems to pop up in our environment from time to time and
>>> trying to figure out how to fix it once and for all.
>>>
>>> We have a page with a form that pops up modal window with a form
>>> specified as well.
>>>
>>> When we try to submit, we get the following exception:
>>>
>>> java.lang.IllegalStateException: ServletRequest does not contain
>>> multipart content. One possible solution is to explicitly call
>>> Form.setMultipart(true), Wicket tries its best to auto-detect multipart
>>> forms but there are certain situation where it cannot.
>>> at
>>> org.apache.wicket.protocol.http.servlet.MultipartServletWebRequest.<init>(MultipartServletWebRequest.java:113)
>>> at
>>> org.apache.wicket.protocol.http.servlet.MultipartServletWebRequest.<init>(MultipartServletWebRequest.java:83)
>>> at
>>> org.apache.wicket.protocol.http.servlet.ServletWebRequest.newMultipartWebRequest(ServletWebRequest.java:500)
>>> at
>>> org.apache.wicket.markup.html.form.Form.handleMultiPart(Form.java:1668)
>>> at org.apache.wicket.markup.html.form.Form.onFormSubmitted(Form.java:862)
>>> at
>>> org.apache.wicket.ajax.form.AjaxFormSubmitBehavior.onEvent(AjaxFormSubmitBehavior.java:135)
>>> at
>>> org.apache.wicket.ajax.AjaxEventBehavior.respond(AjaxEventBehavior.java:177)
>>> ...
>>>
>>> Setting Form.setMultipart(true) on either form has no affect.
>>>
>>> We are running Wicket Version 1.4.7.
>>>
>>> Is there a fix for this issue?
>>>
>>> Is this JIRA Issue related???
>>> https://issues.apache.org/jira/browse/WICKET-2749
>>>
>>>
>>>
>>>
>>
>> ---------------------------------------------------------------------
>> 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: Nested Forms and Multipart Fileupload Issue

Posted by Michał Letyński <ml...@consol.pl>.
Is there a wicket version where it works ? I tried  with 1.4.6 and 1.4.7 
but i get the same error which James got.
My use case : I'm trying to submit a form via ajax to upload a file  
inside modal window.
After debug:
FileUploadBase.isMultipartContent get false because

if (contentType.toLowerCase().startsWith(MULTIPART))   - contentType = 
application/x-www-form-urlencoded
 
James Carman pisze:
> You're trying to submit a form via ajax to upload a file?
>
> On Tue, Mar 9, 2010 at 4:26 PM, Corbin, James <jc...@iqnavigator.com> wrote:
>   
>> This issue seems to pop up in our environment from time to time and trying to figure out how to fix it once and for all.
>>
>> We have a page with a form that pops up modal window with a form specified as well.
>>
>> When we try to submit, we get the following exception:
>>
>> java.lang.IllegalStateException: ServletRequest does not contain multipart content. One possible solution is to explicitly call Form.setMultipart(true), Wicket tries its best to auto-detect multipart forms but there are certain situation where it cannot.
>> at org.apache.wicket.protocol.http.servlet.MultipartServletWebRequest.<init>(MultipartServletWebRequest.java:113)
>> at org.apache.wicket.protocol.http.servlet.MultipartServletWebRequest.<init>(MultipartServletWebRequest.java:83)
>> at org.apache.wicket.protocol.http.servlet.ServletWebRequest.newMultipartWebRequest(ServletWebRequest.java:500)
>> at org.apache.wicket.markup.html.form.Form.handleMultiPart(Form.java:1668)
>> at org.apache.wicket.markup.html.form.Form.onFormSubmitted(Form.java:862)
>> at org.apache.wicket.ajax.form.AjaxFormSubmitBehavior.onEvent(AjaxFormSubmitBehavior.java:135)
>> at org.apache.wicket.ajax.AjaxEventBehavior.respond(AjaxEventBehavior.java:177)
>> ...
>>
>> Setting Form.setMultipart(true) on either form has no affect.
>>
>> We are running Wicket Version 1.4.7.
>>
>> Is there a fix for this issue?
>>
>> Is this JIRA Issue related??? https://issues.apache.org/jira/browse/WICKET-2749
>>
>>
>>
>>     
>
> ---------------------------------------------------------------------
> 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: Nested Forms and Multipart Fileupload Issue

Posted by "Corbin, James" <jc...@iqnavigator.com>.
My submit action is on the modal popup which does NOT contain a FileUpload Field, but the form the modal is launched from does have a FileUpload field.

So, we have a page with a button added to a form that pops up a modal dialog that also defines a form.  This modal popup has a Submit button that does so via Ajax (e.g., AjaxButton).

Once we click the ajax submit button, we get the error below.


-----Original Message-----
From: James Carman [mailto:jcarman@carmanconsulting.com] 
Sent: Tuesday, March 09, 2010 2:30 PM
To: users@wicket.apache.org
Subject: Re: Nested Forms and Multipart Fileupload Issue

You're trying to submit a form via ajax to upload a file?

On Tue, Mar 9, 2010 at 4:26 PM, Corbin, James <jc...@iqnavigator.com> wrote:
> This issue seems to pop up in our environment from time to time and trying to figure out how to fix it once and for all.
>
> We have a page with a form that pops up modal window with a form specified as well.
>
> When we try to submit, we get the following exception:
>
> java.lang.IllegalStateException: ServletRequest does not contain multipart content. One possible solution is to explicitly call Form.setMultipart(true), Wicket tries its best to auto-detect multipart forms but there are certain situation where it cannot.
> at org.apache.wicket.protocol.http.servlet.MultipartServletWebRequest.<init>(MultipartServletWebRequest.java:113)
> at org.apache.wicket.protocol.http.servlet.MultipartServletWebRequest.<init>(MultipartServletWebRequest.java:83)
> at org.apache.wicket.protocol.http.servlet.ServletWebRequest.newMultipartWebRequest(ServletWebRequest.java:500)
> at org.apache.wicket.markup.html.form.Form.handleMultiPart(Form.java:1668)
> at org.apache.wicket.markup.html.form.Form.onFormSubmitted(Form.java:862)
> at org.apache.wicket.ajax.form.AjaxFormSubmitBehavior.onEvent(AjaxFormSubmitBehavior.java:135)
> at org.apache.wicket.ajax.AjaxEventBehavior.respond(AjaxEventBehavior.java:177)
> ...
>
> Setting Form.setMultipart(true) on either form has no affect.
>
> We are running Wicket Version 1.4.7.
>
> Is there a fix for this issue?
>
> Is this JIRA Issue related??? https://issues.apache.org/jira/browse/WICKET-2749
>
>
>

---------------------------------------------------------------------
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: Nested Forms and Multipart Fileupload Issue

Posted by James Carman <jc...@carmanconsulting.com>.
You're trying to submit a form via ajax to upload a file?

On Tue, Mar 9, 2010 at 4:26 PM, Corbin, James <jc...@iqnavigator.com> wrote:
> This issue seems to pop up in our environment from time to time and trying to figure out how to fix it once and for all.
>
> We have a page with a form that pops up modal window with a form specified as well.
>
> When we try to submit, we get the following exception:
>
> java.lang.IllegalStateException: ServletRequest does not contain multipart content. One possible solution is to explicitly call Form.setMultipart(true), Wicket tries its best to auto-detect multipart forms but there are certain situation where it cannot.
> at org.apache.wicket.protocol.http.servlet.MultipartServletWebRequest.<init>(MultipartServletWebRequest.java:113)
> at org.apache.wicket.protocol.http.servlet.MultipartServletWebRequest.<init>(MultipartServletWebRequest.java:83)
> at org.apache.wicket.protocol.http.servlet.ServletWebRequest.newMultipartWebRequest(ServletWebRequest.java:500)
> at org.apache.wicket.markup.html.form.Form.handleMultiPart(Form.java:1668)
> at org.apache.wicket.markup.html.form.Form.onFormSubmitted(Form.java:862)
> at org.apache.wicket.ajax.form.AjaxFormSubmitBehavior.onEvent(AjaxFormSubmitBehavior.java:135)
> at org.apache.wicket.ajax.AjaxEventBehavior.respond(AjaxEventBehavior.java:177)
> ...
>
> Setting Form.setMultipart(true) on either form has no affect.
>
> We are running Wicket Version 1.4.7.
>
> Is there a fix for this issue?
>
> Is this JIRA Issue related??? https://issues.apache.org/jira/browse/WICKET-2749
>
>
>

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


Re: Nested Forms and Multipart Fileupload Issue

Posted by marnold <ma...@iqnavigator.com>.
Was this issue resolved? I am running on the same codebase and have the same
issue.


jcorbin wrote
> 
> This issue seems to pop up in our environment from time to time and trying
> to figure out how to fix it once and for all.
> 
> We have a page with a form that pops up modal window with a form specified
> as well.
> 
> When we try to submit, we get the following exception:
> 
> java.lang.IllegalStateException: ServletRequest does not contain multipart
> content. One possible solution is to explicitly call
> Form.setMultipart(true), Wicket tries its best to auto-detect multipart
> forms but there are certain situation where it cannot.
> at
> org.apache.wicket.protocol.http.servlet.MultipartServletWebRequest.<init>(MultipartServletWebRequest.java:113)
> at
> org.apache.wicket.protocol.http.servlet.MultipartServletWebRequest.<init>(MultipartServletWebRequest.java:83)
> at
> org.apache.wicket.protocol.http.servlet.ServletWebRequest.newMultipartWebRequest(ServletWebRequest.java:500)
> at org.apache.wicket.markup.html.form.Form.handleMultiPart(Form.java:1668)
> at org.apache.wicket.markup.html.form.Form.onFormSubmitted(Form.java:862)
> at
> org.apache.wicket.ajax.form.AjaxFormSubmitBehavior.onEvent(AjaxFormSubmitBehavior.java:135)
> at
> org.apache.wicket.ajax.AjaxEventBehavior.respond(AjaxEventBehavior.java:177)
> ...
> 
> Setting Form.setMultipart(true) on either form has no affect.
> 
> We are running Wicket Version 1.4.7.
> 
> Is there a fix for this issue?
> 
> Is this JIRA Issue related???
> https://issues.apache.org/jira/browse/WICKET-2749
> 


--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/Nested-Forms-and-Multipart-Fileupload-Issue-tp1844365p4174557.html
Sent from the Users forum mailing list archive at Nabble.com.

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