HSSFWorkbook wb = genyoBean.getHSS();//生成的excel
try {
fileOut = response.getOutputStream();
wb.write(fileOut);
fileOut.flush();
} catch (IOException e) {
e.printStackTrace();
if(fileOut != null){
try {
fileOut.close();
} catch (IOException e1) {
e1.printStackTrace();
}
}
}finally {
try {
if(fileOut != null){
fileOut.close();
}
} catch (Exception e) {
e.printStackTrace();
}
}
文件导出,没有问题。
但是页面不刷新。怎么解决啊。
try {
fileOut = response.getOutputStream();
wb.write(fileOut);
fileOut.flush();
} catch (IOException e) {
e.printStackTrace();
if(fileOut != null){
try {
fileOut.close();
} catch (IOException e1) {
e1.printStackTrace();
}
}
}finally {
try {
if(fileOut != null){
fileOut.close();
}
} catch (Exception e) {
e.printStackTrace();
}
}
文件导出,没有问题。
但是页面不刷新。怎么解决啊。
out.println("<script>window.reflsh();</script>");
out.println("<script>window.location.reload();</script>");
报 java.lang.IllegalStateException: Cannot forward. Response already committed.错误,是从定向的问题。