• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Multipart form won't submit with Struts

 
Tomas George
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a Struts 1.2 application that uses file upload in one of the pages. Before adding the `<html:file>` field and changed form type to `multipart/form-data` everything was ok. I was submitting the form through Javascript upon pressing a button. Now, with the input file in place and corresponding form type, when I press the button, the submit is not performed anymore. Nothing happens. Submission code is something like this:

myForm = document.getElementById('form1');
myForm.action = '/myproject/myaction.do';
myform.submit();

I removed the field and the `multipart/form-data` type and everything was fine again.

Then I just added `multipart/form-data` to the field and submit did not work again. I already spent several hours with this issue and I cannot find a solution. It seems really stupid and maybe you have an idea of what's going on.

I've installed live http headers plugin in Firefox and I noticed: - the form gets submitted (even though it will not call my Action class execute) -
the server returns HTTP/1.1 204 No Content Server: Apache-Coyote/1.1 X-Powered-By: Servlet 2.4; ....

Thank you.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic