把aa.xls 文件名保存到一个变量中, 用include 试试, 应该行的, 注意客户端应该已经安装了ececl 。 没试过啊。 呵呵

解决方案 »

  1.   

    你想直接在浏览器里面直接打开你的excel文档的话,如果本身就不支持的话,根本就不行没有试过,感觉有点难度!
      

  2.   

    File f = new File("d:/1.xls");
            FileInputStream fstream = new FileInputStream(f);
            DataInputStream in = new DataInputStream(fstream);
            byte[] b = new byte[1];
            String s="";
            String mm="";
            ServletOutputStream ss;
            while((s=in.readLine())!= null){
               b = s.getBytes("ISO8859_1");
               ss = response.getOutputStream(); 
               response.reset();
               response.setContentType("application/msexcel"); 
               ss.write(b);                  
               response.setContentLength(b.length);                 
               ss.flush();
            }
            in.close();
            fstream.close();还没测试过,你试试看~
      

  3.   

    我曾经试过在asp中打开excel,对于这个微软好像没有提供像访问access那么好的机制,导致每次访问excel表都会打开一个excel进程对excel文件进行访问,会占用服务器的大量资源!建议你不要使用!
      

  4.   

    asp中尚且如此,微软难道会对java做什么好事吗?