我在wicket中寫了一個面板,讓我上傳一個文件,它完全可以工作。
但是當我把在其他形式(wicket:id="outerForm"
)該面板,並上傳文件時,它拋出從(component id= outerForm
)異常:
在使用FileUpload時嵌套窗體上的檢票窗問題
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.
但outerform
我已經打電話form.setMultipart(true)
沒有人知道如何解決它?
我使用1.4.21檢票
感謝
你不試圖通過AJAX提交外部表單嗎?另外檢查你是否真的使用POST方法提交外部表單。 –
是的,我通過AJAX提交外部表單。問題已解決。是我的錯。還有一個外部形式。它工作正常。你需要爲所有表單編寫'form.setMultipart(true)'。 –