设置文件名字
String fileName= "";
InputStream is =new FileInputStream(file);
String path = request.getSession().getServletContext().getRealPath("/index/开心.txt");
File file =new File(path);
if(!file.exists()){
file.createNewFile();
}
FileOutputStream fos =new FileOutputStream(file);
//获得输出流
//遍历输出
String a = "";
for (int i=0;i<list.size();i++) {
Map map=(Map)list.get(i);
a+=map.get("GAME_ID").toString();
}
bw.write(a);
bw.flush();
bw.close();
String fileName= "";
InputStream is =new FileInputStream(file);
String path = request.getSession().getServletContext().getRealPath("/index/开心.txt");
File file =new File(path);
if(!file.exists()){
file.createNewFile();
}
FileOutputStream fos =new FileOutputStream(file);
//获得输出流
OutputStreamWriter bos =new OutputStreamWriter(fos);
//遍历输出
String a = "";
for (int i=0;i<list.size();i++) {
Map map=(Map)list.get(i);
a+=map.get("GAME_ID").toString();
}
bw.write(a);
bw.flush();
bw.close();