@@ -0,0 +1,1869 @@
+package org.mycat.web.action;%0A%0Aimport java.io.IOException;%0Aimport java.util.List;%0Aimport java.util.Map;%0A%0Aimport javax.servlet.http.HttpServletRequest;%0Aimport javax.servlet.http.HttpServletResponse;%0A%0Aimport org.hx.rainbow.common.context.RainbowContext;%0Aimport org.hx.rainbow.common.core.service.SoaManager;%0Aimport org.springframework.stereotype.Controller;%0Aimport org.springframework.web.bind.annotation.RequestMapping;%0A%0A@Controller%0A@RequestMapping(%22/csvAction%22)%0Apublic class CsvAction %7B%0A%0A%09@RequestMapping(%22/excelCSV%22)%0A%09public void exportExcel(HttpServletResponse response,%0A%09%09%09HttpServletRequest request) %7B%0A%09%09String fileName = request.getParameter(%22fileName%22);%0A%09%09if (fileName == null %7C%7C fileName.isEmpty()) %7B%0A%09%09%09fileName = %22default%22;%0A%09%09%7D%0A%09%09response.reset();%0A%09%09response.setContentType(%22application/csv%22);%0A%09%09response.addHeader(%22Content-Disposition%22, %22attachment; filename=%5C%22%22+ fileName + %22%5C%22.csv%22);%0A%0A%09%09java.io.OutputStream outp = null;%0A%0A%09%09try %7B%0A%09%09%09outp = response.getOutputStream();%0A%09%09%09String serviceName = request.getParameter(%22service%22);%0A%09%09%09String methodName = request.getParameter(%22method%22);%0A%09%09%09RainbowContext context = new RainbowContext(serviceName, methodName);%0A%09%09%09context.addAttr(%22ds%22, request.getParameter(%22ds%22));%0A%09%09%09SoaManager.getInstance().invoke(context);%0A%09%09%09int filelength = 0;%0A%09%09%09if (context.isSuccess()) %7B%0A%0A%09%09%09%09List%3CMap%3CString, Object%3E%3E dataList = context.getRows();%0A%09%09%09%09for (Map%3CString, Object%3E data : dataList) %7B%0A%09%09%09%09%09String values = data.values().toString();%0A%09%09%09%09%09outp.write(values.getBytes());%0A%09%09%09%09%09filelength += values.length();%0A%09%09%09%09%7D%0A%09%09%09%09response.setHeader(%22Content_length%22,%0A%09%09%09%09%09%09new Integer(filelength).toString());%0A%0A%09%09%09%7D else %7B%0A%09%09%09%09outp.write(context.getMsg().getBytes());%0A%09%09%09%7D%0A%09%09%7D catch (Exception ex) %7B%0A%0A%09%09%7D finally %7B%0A%09%09%09if (outp != null) %7B%0A%09%09%09%09try %7B%0A%09%09%09%09%09outp.flush();%0A%09%09%09%09%7D catch (IOException e) %7B%0A%09%09%09%09%09e.printStackTrace();%0A%09%09%09%09%7D%0A%09%09%09%7D%0A%09%09%7D%0A%09%7D%0A%0A%7D%0A

Revert "修改csv导出bug"