Meaningless Drivel is fun!*
The moose likes Struts and the fly likes Download file issue Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Download file issue" Watch "Download file issue" New topic
Author

Download file issue

khaled hanafy
Greenhorn

Joined: Jun 28, 2010
Posts: 25
Hi all,

I made Download file example and it works well but when the download box opened and i click on the open or save button the form subbmited again !!


Any idea ?
debraj mallick
Ranch Hand

Joined: Mar 08, 2011
Posts: 188

hi khaled hanafy,

you did not mention which version on struts you are using, if you are using struts1 then use saveToken() to prevent duplicate form submit, if struts2 use token interceptor.

by any chance are you using custom interceptor?
khaled hanafy
Greenhorn

Joined: Jun 28, 2010
Posts: 25
Thanks alot debraj mallick for your fast response.


i am using struts2 i don't use any custom interceptor and this is my action in struts.xml :




I tried to use the token interceptor but this interceptor will redirect me to another page and doesn't enter to the download file result !!
Mohana Rao Sv
Ranch Hand

Joined: Aug 01, 2007
Posts: 485

Another page means error page?


ocjp 6 — Feeding a person with food is a great thing in this world. Feeding the same person by transferring the knowledge is far more better thing. The reason is the amount of satisfaction which we get through food is of only one minute or two. But the satisfaction which we can get through the knowledge is of life long.
khaled hanafy
Greenhorn

Joined: Jun 28, 2010
Posts: 25


Yes ,Mohana Rao, i mean the error page ,but the problem is the download dialog doesn't open.
debraj mallick
Ranch Hand

Joined: Mar 08, 2011
Posts: 188



could you please give the entire struts.xml.
check the order in your struts.xml like
package
result-types
interceptors
default-interceptor-ref
global-results
global-exception-mappings and then
action
khaled hanafy
Greenhorn

Joined: Jun 28, 2010
Posts: 25

Thanks alot debraj mallick for your valuable effort.

This is my struts.xml

 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Download file issue
 
Similar Threads
File download
DB2 Driver using os390 and websphere
xml4j.jar
downloading ram files?????
servlet doesn't work