服务器端做了下面的事情:
HttpServletResponse response = ((AppWorkspace)this.getWorkspace()).getResponse();
response.reset();
response.setContentType("application/vnd.ms-excel;charset=" + ((AppWorkspace)this.getWorkspace()).getEncode());
ServletOutputStream out = response.getOutputStream();
FileInputStream fis = new FileInputStream("/data/test/test.xls");
byte[] buff = new byte[1024];
int bytesRead;
while((bytesRead = fis.read(buff,0,buff.length)) != -1)
{
  out.write(buff, 0, bytesRead);
}

解决方案 »

  1.   

    可以在html中设置的!
    在<a href=""  target="_blank"(加上的)></a>
      

  2.   

    可是我要打开的内容是HttpServletResponse response 里面的东西,
    setContentType: application/vnd.ms-excel;charset
    不是text/html.在原来提交的页面上只是一个提交请求的链接,不是简单的加个<a></a>
      

  3.   

    gz
    试试在out理输出javascript脚本