<%@page import="java.io.*"%><%
//File creation
String strPath = "C:\\example.txt";
File strFile = new File(strPath);
boolean fileCreated = strFile.createNewFile();
//File appending
Writer objWriter = new BufferedWriter(new FileWriter(strFile));
objWriter.write("This is a test");
objWriter.flush();
objWriter.close();
%> source: stackoverflow https://stackoverflow.com/questions/5177305/creation-of-a-text-file-in-jsp
//File creation
String strPath = "C:\\example.txt";
File strFile = new File(strPath);
boolean fileCreated = strFile.createNewFile();
//File appending
Writer objWriter = new BufferedWriter(new FileWriter(strFile));
objWriter.write("This is a test");
objWriter.flush();
objWriter.close();
%> source: stackoverflow https://stackoverflow.com/questions/5177305/creation-of-a-text-file-in-jsp
No comments:
Post a Comment