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

Ampere's circuital law

  Ampere's circuital law states that the line integral of a magnetic field around any closed loop is equal to the permeability of free s...