Wednesday, April 1, 2020

Creation of a txt file through JSP

<%@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

No comments:

Post a Comment

Is the number of all INTO functions from the set {1, 2, 3, ..... n} to itself equal to all number of MANY to ONE fuctions?

Yes,  t he number of all into functions from the set {1, 2, 3, .... n} to itself is exactly equal to the number of many-to-one functions ...