我想通过从本地读取文件流的方式将pdf显示在ie中,奇怪的是在tomcat中显示正常,但是在weblogic下就不能显示了,显示的是乱码。
代码如下
<%@ page contentType="text/HTML; charset=GBK" %><%@ page import="java.io.*"%>
<%
    InputStream dataIn = new FileInputStream("D:\\Tomcat5.0\\webapps\\shbank1/1.pdf");
    ServletOutputStream out1 = response.getOutputStream();
 byte[] b = new byte[2048];
  int len = 0;
    while ((len =dataIn.read(b)) > 0) {
       out1.write(b, 0, len);
    }
    out1.flush();
   out1.close();
    dataIn.close();%>