|
![]() |
名片设计 CorelDRAW Illustrator AuotoCAD Painter 其他软件 Photoshop Fireworks Flash |
|
使用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(); } catch(IOException e) { out.println(e.getMessage()); } %> 现在,打开imp.txt加以查看,字符串"print me"应该已经写入 返回类别: 教程 上一教程: 连接MYSQL的JAVABEAN 下一教程: JSP中文乱码问题解决方式小结 您可以阅读与"在JSP中写TEXT文件"相关的教程: · JSP读取TEXT文件 · JSPSMART实现文件上传时FILE和TEXT表单同时提交的问题 · JAVA,JSP,JAVASCRIPT中如何实现将统计表格保存成EXCEL文件 · 利用ITEXT在JSP中生成PDF报表 · JSP文件操作之写入篇 |
![]() ![]() |
快精灵印艺坊 版权所有 |
首页![]() ![]() ![]() ![]() ![]() ![]() ![]() |