sgzwiz / jsonplugin

Automatically exported from code.google.com/p/jsonplugin
0 stars 1 forks source link

Can't receive JSON response with YUI file upload in Struts2 #71

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Create file upload using struts2 and YUI as defined here:
http://thecodecentral.com/2007/09/04/asynchronous-file-upload-yuis-approach
2. Create response, defining <result type="json" /> in struts.xml
3.

What is the expected output? What do you see instead?
I expect my javascript callback to receive the json string.  What happens
is the browser (ff 3) prompts me to download myAction.action.  This is
because the content-type is "application/json".  If I change the response
type to something else (like plain text), My callback gets the event.

What version of the product are you using? On what operating system?
json plugin 0.31 on Windows XP, Mac OS X

Please provide any additional information below.
If I could simply set a parameter to something like <parameter
"content-type">text/html</parameter>, that would likely solve the problem.  

The fundamental problem is that for a file upload, struts is creating an
iframe, which doesn't understand the content-type.  So it prompts the user.

Original issue reported on code.google.com by davidbar...@gmail.com on 14 Nov 2008 at 6:57

GoogleCodeExporter commented 9 years ago
what do you propose as a solution? to add a content type parameter?

Original comment by musa...@gmail.com on 30 Dec 2008 at 3:58

GoogleCodeExporter commented 9 years ago
contentType parameter added

Original comment by musa...@gmail.com on 30 Dec 2008 at 4:14

GoogleCodeExporter commented 9 years ago
i have the same problem, which was the solution? please explain

Original comment by jorguito...@gmail.com on 26 Aug 2009 at 2:20