struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From umeshkudtarkar <ukudtar...@strongmail.com>
Subject Re: Redirect after File Upload
Date Mon, 13 Aug 2007 17:17:39 GMT

Jan,
Add IFrameIO to your javascript since fileupload uses iframe io transport
instead of XHR.

dojo.require("dojo.io.IframeIO");

Refer to this article for details.
http://ajaxian.com/archives/dojo-uploading-files-and-contents-with-ajax

cheers,
Umesh


Jan Steinke wrote:
> 
> Hi There,
> I would like to upload some jpegs with struts 2.0.9 and redirect to 
> another site after the Action returns SUCCESS.
> I tried is like this ( after reading the file upload example from the 
> struts 2 showcases):
> 
> uploadPictureForm.jsp:
> 
>                <s:form action="uploadPicture.action" method="POST" 
> enctype="multipart/form-data">
>                    Datei hochladen (1): <s:file name="upload" 
> accept="image/*"/><br>
>                    Datei hochladen (2): <s:file name="upload" 
> accept="image/*"/><br>
>                    Datei hochladen (3): <s:file name="upload" 
> accept="image/*"/><br>
>                    Datei hochladen (4): <s:file name="upload" 
> accept="image/*"/><br>
>                    Datei hochladen (5): <s:file name="upload" 
> accept="image/*"/><br>
>                    <s:a theme="ajax" targets="center" 
> executeScripts="true" showLoadingText="true">upload</s:a>
>                </s:form>
> 
> actions.xml (package inside struts.xml):
> 
>        <action name="uploadPicture" class="actions.UploadPictureAction" 
> method="upload">
>             <result name="input">uploadPictureForm.jsp</result>
>             <result>viewPictures.jsp</result>
>        </action>
> 
> UploadPictureAction.java:
> 
> ...
>    private File[] upload;
>         public String upload() throws Exception {
>        if(upload != null) {
>            ... // do something with my files
>            }
>          ....           System.out.println("reached End of Action");
>                 return SUCCESS;
>    } 
> ...
> 
> Works fine except there's no redirect after return SUCCESS  (I also 
> tried different  combinations in actions.xml like
> <result name="success" type="redirect">....
> But I get the same result. Successfull upload and no redirect ).
> It works only with removing the ajax tags inside the upload form. But I 
> need ajax. Does someone of you now, whether
> that's a struts bug? I've searched about that already with google etc. 
> with no results about that.
> 
> Thanks for every reply,
> 
> Jan
> 
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Redirect-after-File-Upload-tf4259578.html#a12130325
Sent from the Struts - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Mime
View raw message