Jspx provides a common method to write files directly to the client.
void writeFile(byte file, String fileName, String mimeType)
This method can be called from any jspx controller.
In some application that is using SSL for HTTPS interface. we noticed that if the client side is IE then we got the following error.
Internet Explorer cannot download Internet Explorer was not able to open this Internet site. The requested site is either unavailable or cannot be found. Please try again later.
We googled the web for such error and ended with the result that is described here
we had to remove both header (Pragma, Cache-Control)
so we did that in the writeFile method and now it look like this:
public void writeFile(byte file, String fileName, String mimeType)
this.response.setHeader("Content-disposition", "attachment; filename=" + fileName);
// [May 23, 2010 4:51:08 PM] [Amr.ElAdawy] [removing the caching control headers
// in order to solve the https problem]
OutputStream out = this.response.getOutputStream();
catch (IOException e)
catch (Exception e)
logger.error("Excpetion while writing file file ", e);
which had solved the problem