You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by "Martin Grigorov (JIRA)" <ji...@apache.org> on 2010/01/17 10:01:54 UTC

[jira] Commented: (WICKET-2611) Class Cast Exception when combining UploadRequest, MultiPartForm, and MultiWindowSupport

    [ https://issues.apache.org/jira/browse/WICKET-2611?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12801349#action_12801349 ] 

Martin Grigorov commented on WICKET-2611:
-----------------------------------------

The exception says it all:
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.extensions.ajax.markup.html.form.upload.MultipartRequest.<init>(MultipartRequest.java:41)
	at org.apache.wicket.extensions.ajax.markup.html.form.upload.UploadWebRequest.newMultipartWebRequest(UploadWebRequest.java:66)
	at org.apache.wicket.markup.html.form.Form.handleMultiPart(Form.java:1675)
	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)
	at org.apache.wicket.ajax.AbstractDefaultAjaxBehavior.onRequest(AbstractDefaultAjaxBehavior.java:299)
	at org.apache.wicket.util.tester.BaseWicketTester.clickLink(BaseWicketTester.java:757)
	at com.example.TestHomePage.testRenderMyPage(TestHomePage.java:34)
       ....

You need to call form.setMultiPart(true) on the two forms you use.
Doing this makes the provided test case to pass.

> Class Cast Exception when combining UploadRequest, MultiPartForm, and MultiWindowSupport
> ----------------------------------------------------------------------------------------
>
>                 Key: WICKET-2611
>                 URL: https://issues.apache.org/jira/browse/WICKET-2611
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>    Affects Versions: 1.4.1
>            Reporter: Douglas Ferguson
>         Attachments: testMultiPart+UploadRequest+MultiWindowSupport.zip
>
>
> See the quick start.
> I get an error in the test case, but it is different than what I see in the web app, so I would recommend looking at the web app first.
> You will find instructions on the home page of the quick start for recreating the issue.
> Note: I believe that is possible to recreate this with multi-window support off, but it seems more difficult and there are also situations where the exception isn't throw but there are url becomes mangled and includes parameters like this : org.apache.wicket.markup.html.WicketEventReference/wicket-event.js

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.