waysun一路陽光

          不輕易服輸,不輕言放棄.--心是夢的舞臺,心有多大,舞臺有多大。踏踏實(shí)實(shí)做事,認(rèn)認(rèn)真真做人。

            BlogJava :: 首頁 :: 新隨筆 :: 聯(lián)系 ::  :: 管理 ::
            167 隨筆 :: 1 文章 :: 64 評論 :: 0 Trackbacks

          <%@ page contentType="text/html; charset=utf-8" language="java" import="java.io.*,java.net.*" errorPage="" %>
          <%@ page import="com.easyvary.form.util.*"%>
          <%@ page import="java.io.*"%>
          <%@ page import="java.util.*"%>
          <%@ page import="javax.servlet.*"%>
          <%@ page import="net.sf.hibernate.*"%>
          <%@ page import="org.apache.commons.fileupload.*"%>
          <%@ page import="com.easyvary.common.util.*"%>
          <%@ page import="com.easyvary.form.*"%>
          <%@ page import="com.easyvary.form.util.*"%>
          <%@ page import="com.easyvary.system.*"%>
          <%@ page import="com.easyvary.system.GmccObject"%>
          <%@ page import="com.bpm.pm.*"%>
          <%@page import="proc.pm.monitor.CellAlarm"%>
          <%@page import="proc.ibpm.alarm.*" %>
          <%@page import="proc.ibpm.global.*" %>
          <%@page import="com.ibpm.conf.*" %>
          <%@page import="proc.ibpm.structure.*" %>
          <%@ page import="proc.ibpm.conf.*"%>
          <%@page import="proc.ibpm.history.*" %>
          <%
           Get get = new Get();
           HistoryAlarmProcessor hap = new HistoryAlarmProcessor();
           String cellTypeConfId = request.getParameter("cellTypeConfId");
           if(cellTypeConfId==null){
            cellTypeConfId = "";
           }
           String cellConfId = request.getParameter("cellConfId");
           String startAlarmTime = request.getParameter("startAlarmTime");
           String endAlarmTime = request.getParameter("endAlarmTime");
           String startRecoverTime = request.getParameter("startRecoverTime");
           String endRecoverTime = request.getParameter("endRecoverTime");
           String recoverType = request.getParameter("recoverType");
           
           String cellTypeShowName = get.getCellTypeShowName(cellTypeConfId);
           hap.setRecordCount(cellTypeConfId,cellConfId,startAlarmTime,endAlarmTime,startRecoverTime,endRecoverTime,recoverType);
           hap.setPageTotal(cellTypeConfId,cellConfId,startAlarmTime,endAlarmTime,startRecoverTime,endRecoverTime,recoverType);
              String filepath="test.txt";//request.getParameter("path");
              // 設(shè)置HTTP頭:
              response.reset();
              response.setContentType("application/octet-stream");
              String fileName= URLDecoder.decode(filepath,"utf-8");
              java.net.URLEncoder.encode(fileName, "utf-8");
              response.addHeader("Content-Disposition","attachment;"+ "filename=\"" +URLEncoder.encode(fileName, "utf-8") + "\"");
              BufferedOutputStream output = null;
              BufferedInputStream input = null;
              OutputStream os =null;
              //FileInputStream fis =null;
              // 寫緩沖區(qū):
              try
              {
                             
                              os = response.getOutputStream();
                              String historyAlarm="";//historyAlarm為后臺得到的數(shù)據(jù)
                              byte[]byt=historyAlarm.getBytes();
                             os.write(byt);

              }
              catch(Exception e)
              {
                  System.out.println(e);
              }
              finally
              {
                  //fis.close();
               os.flush();
               os.close();
                  if(input!=null) input.close();
                  if(output!=null) output.close();
              }
              return;


          %>

          posted on 2008-08-14 10:18 weesun一米陽光 閱讀(5121) 評論(2)  編輯  收藏 所屬分類: 總結(jié)備用

          評論

          # re: jsp導(dǎo)出TXT文件 2012-12-04 18:55 阿什頓
          水電費(fèi)是打發(fā)士大夫告訴對方告訴對方公司的風(fēng)格  回復(fù)  更多評論
            

          # re: jsp導(dǎo)出TXT文件 2013-06-02 17:55 jjkk
          nnnn  回復(fù)  更多評論
            

          主站蜘蛛池模板: 荣成市| 博客| 临沂市| 柳江县| 延川县| 景谷| 咸丰县| 左权县| 嘉鱼县| 锡林浩特市| 东乌珠穆沁旗| 渝北区| 尉氏县| 华宁县| 虎林市| 武川县| 抚松县| 汉源县| 木兰县| 长兴县| 郓城县| 灵宝市| 巴林左旗| 西乌珠穆沁旗| 屏东县| 黄龙县| 栖霞市| 巴林右旗| 宜章县| 五指山市| 卫辉市| 永善县| 闻喜县| 永新县| 寻甸| 库尔勒市| 汉中市| 丰原市| 遂溪县| 富民县| 太保市|