sendRedirect() & forward() will both work. Redirect will cause an extra round trip call.
idarke: If you want to send 1 file instead of 3, I imagine you can zip it up on the fly & then call forward().
palbano: Writing directly to ServletOutputStream (thanks idarke, I totally forgot I can do...
Excellent! This is exactly what I wanted. Thank you! I was doing:
response.sendRedirect(exeFile);
instead of writing the file contents directly to the response output stream as in your example.
Naturally my redirect causes the browser to make a new request to the server for that file...
Oops I left out the most important part of the question:
response.sendRedirect(location) works as long as the temp file is somewhere under my /context, eg
https://hostname/myapp/temp/tempfile.zip
However, for security reasons I rather generate the temp files in either
a) java.io.tmpdir, (eg...
Hi all,
I am trying to implement the exact same thing as above. I have a JSP that submits a query & a Servlet that creates a temp CSV file.
My question is, how do I send this back to the return view & if possible, automatically popup a SaveAs Dialog?
Code samples will be greatly appreciated...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.