ByteArrayOutputStream baos = new ByteArrayOutputStream();
PrintStream ps = new PrintStream(baos);
ps.print(new String(returnStr));
ServletOutputStream sos = response.getOutputStream();
baos.writeTo(sos);
sos.flush();
sos.close();
Then return null ActionForward in your action method.
Thanks,
Yuan
The problem I think is that you are never writing your output to the
Response object. I'm guessing you think that setting the filename in the
header as you are doing will be sufficient, but it's not. Try something
along these lines:
ServletOutputStream out = response.getOutputStream();
ba.wri
Miquel,
All you are doing is writing out a file on your server and then sending back
an empty response to the user - if you want to download the file, you need
to write it out to the response.
Try creating your file by writing it to a ByteArrayOutputStream, rather than
FileOutputStream
ByteAr
3 matches
Mail list logo