Author: athobani Sep 27, 2002 11:40 AM
I am fairly new to
JSP and having problem with this piece of code, any insight will be appreciated. thanks
<%@ page contentType="application/vnd.ms-excel" autoFlush="false"
import="java.io.*, org.apache.poi.hssf.usermodel.HSSFWorkbook"
%>
<jsp:useBean id="FRNW" class="jsptutorial.JSPExcelUsingHSSFBean" scope="application" />
<%
try {
HSSFWorkbook wb = FRNW.createSheet() ;
ServletOutputStream os = response.getOutputStream();
wb.write(os);
os.flush();
} catch (Exception e) {
out.println("error in JSP");
}
%>
the code works and output what I excpected to see, but produce this error message on server. "java.lang.IllegalStateException: getOutputStream() has already been called for this response"
any idea what's going on...???