struts2 要求在列表中点下载的时候,生成zip文件,里面文件为responseResult.properties,内容为ip=192.168.72.209
port=8080
createTime=2012-08-16 13:30:50
帮帮忙啊 着急用
------解决方案--------------------
-_-! 话说有分拿
ZipOutputStream bos=null;
try{
ZipEntry entry=new ZipEntry("some.properties");
bos=new ZipOutputStream(new FileOutputStream("d:/some.zip"));
bos.putNextEntry(entry);
bos.write("id=192.168.1.1\r\n".getBytes());
bos.write("port=8080\r\n".getBytes());
bos.write("createTime=2012-08-16 13:30:50\r\n".getBytes());
bos.flush();
}catch(IOException e){
//xx00
}finally{
bos.close();
}