the following code may help you....
FileWriter raf = new FileWriter("out.txt", true);
PrintWriter pr = new PrintWriter(raf, true);
pr.println(xmaxt);
pr.println(sample);
thanx
zulfi
----- Original Message -----
From: Mehmet Gok <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Saturday, April 29, 2000 8:45 PM
Subject: servlets with file I/O
> hi everybody
> firstly I'm new in servlet programming.
> My problem is:
> I have a HTML form. By using servlets I read the data in this form and
> then in a new page I print this data. It works, namely i can read data and
> print it.
> But I just want to write this data into a file. In doPost() methos I write
>
> String xmax=request.getParameter("xmax"); file://xmax is name of the form
entry
> String sample=request.getParameter("sample");//sample is name of the form
> file://entry.input type is
text.
> DataOutputStream dout=new DataOutputStream(new
> FileOutputStream("out.txt"));
>
> dout.writeBytes(xmax);
> dout.writeBytes(sample);
> dout.flush();
> dout.close();
>
>
> when I use this code in doPost() method, it does not write data to
> "out.txt" even it does not create it.
> How can I solve this problem?
> I really need help. thanks
>
> PS: I need some online tutorials about servlets, I could just find a few.
> Do you recommend an URL ?
>
>
___________________________________________________________________________
> To unsubscribe, send email to [EMAIL PROTECTED] and include in the
body
> of the message "signoff SERVLET-INTEREST".
>
> Archives: http://archives.java.sun.com/archives/servlet-interest.html
> Resources: http://java.sun.com/products/servlet/external-resources.html
> LISTSERV Help: http://www.lsoft.com/manuals/user/user.html
>
___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".
Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html