public void createFile() {
    FileWriter fw = null;
    PrintWriter pw = null;
    try {
        fw = new FileWriter( "newFile.txt");
        pw = new PrintWriter( fw);
        pw.print( [variable containing the text]);
        return;
    } catch( IOException e) {
        e.printStackTrace();
    } finally {
        if( pw != null) {
            pw.close();
        }
    }
}

Cheers!
Mark

----- Original Message -----
From: "Saad Shareef" <[EMAIL PROTECTED]>
Sent: Tuesday, June 26, 2001 1:48 AM


> How can i create a text file from within a servlet??

___________________________________________________________________________
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

Reply via email to