少年阿宾

那些青春的岁月

  BlogJava :: 首页 :: 联系 :: 聚合  :: 管理
  500 Posts :: 0 Stories :: 135 Comments :: 0 Trackbacks
   try {
            response.setContentType("application/vnd.ms-excel;charset=UTF-8");
            response.setHeader("Content-Disposition", "attachment; filename=" +teamQuery.getTeamId()+ new String(" 项目销量.xls".getBytes("gbk"), "iso8859-1"));
            Boolean flag = manteamService.downFile(teamQuery,response.getOutputStream());
            if (flag) {
                resutMap.put("success", true);

            }

        } catch (UnsupportedEncodingException e) {
            e.printStackTrace();  //To change body of catch statement use File | Settings | File Templates.
        } catch (IOException e) {
            e.printStackTrace();  //To change body of catch statement use File | Settings | File Templates.
        }
一定要有response.getOutputStream()
posted on 2013-09-21 16:06 abin 阅读(587) 评论(0)  编辑  收藏 所属分类: Java 文件操作

只有注册用户登录后才能发表评论。


网站导航: