I want to be able to write some web form values to a CSV (or txt) file. I know ho to
do this easily in ASP, anyone know the easiest way to do it in JSP? Here is the ASP I
have
used.....
WRITE
<%
set FSO = Server.CreateObject("scripting.FileSystemObject")
set myFile = fso.CreateTextFile("C:\test.txt", true)
myFile.WriteLine("stuff")
myFile.WriteLine("more text here")
myFile.Close
%>
READ
<%
Const ForReading = 1, ForWriting = 2, ForAppending = 8
set fso = server.CreateObject("Scripting.FileSystemObject")
set f = fso.GetFile("C:\test.txt")
set ts = f.OpenAsTextStream(ForReading, -2)
TextStreamTest = ts.ReadLine
Do While not ts.AtEndOfStream
myText = myText & ts.ReadLine & vbCrLf
Response.Write myText
Loop
%>
Thanks,
-----------------------
Colin P. Blaney
===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST".
Some relevant FAQs on JSP/Servlets can be found at:
http://java.sun.com/products/jsp/faq.html
http://www.esperanto.org.nz/jsp/jspfaq.html
http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets