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:
<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
------->
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

TechTarget provides technology professionals with the information they need to perform their jobs - from developing strategy, to making cost-effective purchase decisions and managing their organizations technology projects - with its network of technology-specific websites, events and online magazines.