各位兄弟姐妹们帮个忙好吗?
(java)jsp页面上有个"导出"按钮,点击导出后想把结果集(集合rs-此集合已经把数据库中查出的数据封装到集合里)中的数据导出到自己想要保存的目录下。也就是说点击"导出"按钮后,页面弹出个window对话框,可选择保存目录。
想要源代码
小弟先谢谢了哈哈

解决方案 »

  1.   

    再问一下,sql优化有什么好书吗?或者有什么好的电子书,资料等小弟对这个感兴趣了,想研究研究呵呵
      

  2.   

    这个问题没弄过,关注一下,sql优化的资料很多,你搜一下就很多的。
    这里有一个
    http://download.csdn.net/source/970487
      

  3.   

    導出文件名為table.txt<%    
    String txt = (String)request.getAttribute("txt");
        response.setContentType("application/txt");
        response.setHeader("Content-disposition", "attachment;filename=table.txt");
        BufferedOutputStream bos = null;
        try {
          bos = new BufferedOutputStream(response.getOutputStream());
          bos.write(txt.getBytes());
        } catch (IOException e) {
          throw e;
        } finally {
          if (bos != null)
            bos.close();
        }    %>
      

  4.   

    <%@ page contentType="appliation/vnd.ms-excel; charset=utf-8" %>
      <%
    response.addHeader("Content-Disposition", "filename="+new String("收入汇总财务接口".getBytes("GBK"),"ISO-8859-1")+".xls");
      %>
       <!-- 财务汇总 -->
    <table class="tds" id="detailTable">
    <thead>
    <tr>
    <th>admin</th>
    <th>name</th>

    </tr>
    </thead>
    <tbody>
    <s:iterator value="FinanceList">
    <tr> <td class="string">${indexId}</td>
    <td class="string">${custId}</td>class="string">${strateGroup}</td>
    </tr>
    </s:iterator>
    </tbody>
    </table>在写个返回这个页面的方法就可以了