New issue 501 by Din...@gmail.com: Submit Form with
enctype="multipart/form-data" doesn't works :-(
http://code.google.com/p/struts2-jquery/issues/detail?id=501
(This is for feature requests and bugs in Struts2 jQuery Plugin - for
getting help, please use the User Group.
http://groups.google.com/group/struts2-jquery )
What steps will reproduce the problem?
1.Create a struts2 form with enctype="multipart/form-data" like :
<s:form action="doUpload_upload" enctype="multipart/form-data">
<s:select
label="%{getText('list.model.trace')}"
name="traceModelSelected"
list="traceModels"
listKey="localName"
listValue="localName" />
<s:file name="upload" size="100" key="file"
accept="text/csv,text/comma-separated-values"/>
<sj:submit id="sumitFileId"
targets="main"
indicator="indicator"
button="true"
value="%{getText('submit.file')}"
buttonIcon="ui-icon-refresh">
</sj:submit>
</s:form>
2.Click on submit button
3.Saw in Firebug console :struts2_jquery] submit form : doUpload_upload but
nothing append :(
What is the expected output? What do you see instead?
I expect that my file is uploaded but nothing append.
Which struts2 version?
struts 2.2.1.1
Which struts2-jquery plugin version?
struts2-jquery plugin 2.5.3
If i remove in element <form/> the attribute enctype="multipart/form-data"
and the element <file /> the post of form works but when one of these
elements is present nothing append :-(
Hi
Please johgep Could you confirm this bug please ? Or tell me how can I do
this ?
Thanks :)
--
You received this message because you are subscribed to the Google Groups "struts2-jquery" group.
To post to this group, send email to struts2...@googlegroups.com.
To unsubscribe from this group, send email to struts2-jquer...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/struts2-jquery?hl=en.
Comment #2 on issue 501 by johgep: Submit Form with
enctype="multipart/form-data" doesn't works :-(
http://code.google.com/p/struts2-jquery/issues/detail?id=501
I will check this.
Can you please try out the current SNAPSHOT from Maven Repository.
http://oss.sonatype.org/content/repositories/snapshots/com/jgeppert/struts2/jquery/
There is a new form plugin included. I think this solves your problem.
--
You received this message because you are subscribed to the Google Groups "struts2-jquery" group.
To post to this group, send email to struts2...@googlegroups.com.
To unsubscribe from this group, send email to struts2-jquer...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/struts2-jquery?hl=en.
Comment #4 on issue 501 by johgep: Submit Form with
enctype="multipart/form-data" doesn't works :-(
http://code.google.com/p/struts2-jquery/issues/detail?id=501
(No comment was entered for this change.)
Comment #5 on issue 501 by johgep: Submit Form with
Hi Johannes,
This issue come back and I don't understand how solve it :-(
The (source) jar of a simple web application is attached and enable you to
see the bug :
just run the webapp (I used Tomcat 7)
clique on the link "ajax form"
clique on the button "Ajax submit"
And see : the "#formResult" div stay with the waiting message whereas
the "<p>echo ... </p>"
But if you use firebug extension you'll see that the response is correct
and contains "<p>echo : </p>".
No js error is occured, and if you remove the enctype on the form and the
field file : it's works...
I become mad !!!!
Could you please try this ?
Thanks !!!
Which struts2 version?
struts 2.2.1.1
Which struts2-jquery plugin version?
struts2-jquery plugin 3.0.2
and the file ...just add lib folder in WebContent\WEB-INF\
it's the same lib folder as that in showcase.war
Attachments:
mTraceTest.jar 12.0 KB
Comment #8 on issue 501 by johgep: Submit Form with
enctype="multipart/form-data" doesn't works :-(
http://code.google.com/p/struts2-jquery/issues/detail?id=501
Thank you for the test case. This is fixed with new form plugin version in
the trunk.
http://code.google.com/p/struts2-jquery/source/detail?r=1457
Johannes,
Since you were saying that my issue was related to this issue, I thought I
should provide you a sample web app showing the issue I'm talking about,
since I can't attach files in the other discussion I will comment here.
The application is a basic web app which creates a dialog with a form
containing a single file upload. Below that are 2 <sj:a/> links, one that
indicates the formId and a URL to submit to, and a second that does not
contain the additional URL. The first one fails and the second one does not
(look at the post parameters in Firebug).
Attachments:
StrutsJQueryFileUploadTest.zip 20.2 KB
Issue 559 has been merged into this issue.
Johannas,
When using 2.5.x release, I had a form submitted via a sj:submit that sent
a file to the server for storage. The action upon success would close the
dialog and refresh the div where a list of the file uploads were shown. In
the event of an error or a request to go back to the 'input', the struts
XML was configured to return a type of 'httpheader' with values '501'
and '502' accordingly. This worked great because these triggered the
onErrorTopic handler.
Well noticed that the snapshot from Jun 07 was no longer working, so
updated to the snapshot from Jun 21. While the upload works perfectly, the
HTTP response of 501 is not detected as an error and only the
complete/success topics are being published.
Can the onErrorTopic be published when 5xx responses are detected?
Comment #12 on issue 501 by johgep: Submit Form with
enctype="multipart/form-data" doesn't works :-(
http://code.google.com/p/struts2-jquery/issues/detail?id=501
We should create a separate Issue for the onErrorTopic problem.