<%@ page language="java" contentType="text/html; charset=gbk"pageEncoding="gbk"%>
<%@ page import="java.util.*"%>
<%@ page import="java.io.PrintWriter"%>
<%
response.setContentType("application/csv");
response.setHeader("Content-disposition","p_w_upload; filename=XXX.csv");
out.print("XXX\n");
out.print("XX,XX\n");
List list =(List) request.getAttribute("list");
if(list!=null){
int listCount = 0;
listCount = list.size();
for (int i = 0; i < listCount; i++) {
Map m=new HashMap();
m = (Map) list.get(i);
out.print(i+1);
out.print(m.get("XX"));
out.print("\n")
}
out.flush();
}
%>
转载于:https://blog.51cto.com/7632404/1349398