使用PrintWriter对象即可写Text文件。 请参考以下示例: <%@ page import="java.io.*" % <% String str = "print me"; //always give the path from root. This way it almost always works. String nameOfTextFile = "/usr/anil/imp.txt"; try { PrintWriter pw = new PrintWriter(new FileOutputStream(nameOfTextFile)); pw.println(str); //clean up pw.close(...[ 查看全文 ]