> Any examples of doing this in struts 2

You can get the HttpServletResponse by:
   ServletActionContext.getResponse()

And then, you can set the download file name, by:
   response.setHeader("Content-Disposition",
                "attachment; filename=" + fileName);

And then, you can get the OutputStream, by:
  response.getOutputStream()

Finally, you can output zipped data to the OutputStream.



> how to "navigate" to the next display after the download?

I believe you can not navigate to the next page.
Because for one http request, the server side can send only one response.
If you want to download file and then show next page, it need 2 responses.
I think this is impossible mission for one http request.

If you send a file download response, then the browser will download
it, and don't refresh the page, which means the current displayed page
will remain.

If you really want to implement this, may be you need some client side
JavaScript to send a file download request first, and then send
another request to display the next page.

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

Reply via email to