Hi, i really need some help here.
I want to have the user download a file while the button gets clicked, and the file is generated in runtime.
I wrote a simple Action class to
test this. Here's what's inside the perform() method :
String strngContent = "asdfasdfasdfasdf";
// this header is required for the download dialog from the browser to pop up
response.setHeader("Content-Disposition", "attachment; filename=test.download");
response.getOutputStream().write(strngContent.getBytes());
return new ActionForward(mapping.getInput());
And this is the error message that i got :
org.apache.jasper.JasperException: getOutputStream() has already been called for this response
I wonder if there is any work around for this problem in
Struts ? I mean, i've been looking in the Action and RequestProcessor source, and i couldnt find any clue.
Please help, thanks in advance.