Hi
I have a class where the following fuction is written:
================================================
public String getMyCSV()
{
HttpServletResponse Response;
try
{
Response = (HttpServletResponse)getExternalContext().getResponse();
ServletOutputStream outs = Response.getOutputStream();
Response.setContentType("application/vnd.ms-excel");
Response.setHeader("Content-Disposition", "attachment; filename=\"log.csv\"");
Response.setHeader("Cache-Control", "public");
Response.setHeader("pragma", "");
try {
outs.print(getCSVOutput());
} catch (IOException ioe) {
debugLog("Error exporting file", ioe);
}
--------------------------------------->
I have another file which is accessed in the browser to access this function:
------->
Observed: when this JSP file is accessed i get the following error:
Exception occured while loading the page: Servlet response already use stream, Writer not possible.
I was suspecting the following:
the mime-mapping was not available in the web.xml so i added the following:
xls
application/vnd.ms-excel
I would be glad if someone could give me some advice on this.
Regards
Baig