Reputation: 487
I have the following struts def:
<result name="reportSuccessfullyDownloaded" type="stream">
<param name="contentType">application/zip</param>
<param name="contentDisposition">attachment;filename="%{filename}"</param>
</result>
It downloads a .zip file that can contain anywhere from 1-10 generated pdf reports.
What I would like to do is change the app to handle the following situations:
My question is: how can I have more than one "result" for a single Action? I don't see how it's possible. Is it? Or do I have to somehow have to use a "chain" result, which is highly discouraged?
Any help much appreciated.
Upvotes: 3
Views: 1947
Reputation: 285
I know this is very old already but I would suggest you to store the status of the report generation in session, and have an ajax action that serves the status of generation, and another action to download the file.
In that way, you can update the status of the report generation multiple times and serve it nicely like:
And once everything is done you can automatically start the download also. Just make sure to clear the session when the user re-enters the page or how ever seems appropriate.
Upvotes: 1