用jsp直接打开Excel乱码
代码如下:请您看一下 谢谢!
<%@ page language="java" import="java.io.*" pageEncoding="GBK"%>
<%
response.setHeader( "Content-Disposition;charset=GBK ","inline;filename=pzhdsqsp.xls ");
File file = new File("D:/pzhdsqsp.xls");
FileInputStream in = new FileInputStream(file);
byte[] buffer = new byte[in.available()];
in.read(buffer);
response.getOutputStream().write(buffer);
response.getOutputStream().flush();
out.clear();
out = pageContext.pushBody();
%>