FileOutputStream out=new FileOutputStream("acb.txt");
PrintStream p=new PrintStream(out);
p.println("hello word!!");
p.close();其中hello word!!就是内容,你可以替换成字符串至于刷新问题可能是缓存惹的祸
在页面中加上
<META HTTP-EQUIV="Pragma" CONTENT="no-cache">
<META HTTP-EQUIV="cache-control" CONTENT="no-cache">