You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Randy Layman <ra...@aswethink.com> on 2001/06/14 14:12:45 UTC

RE: Using JSP to Save file

	How do you know the file isn't being written?  I am willing to bet
that if you searched your entire system for "economic.txt" you would find
the file, probably in the directory that you started tomcat or the
%TOMCAT_HOME%/bin folder.

	Randy


> -----Original Message-----
> From: Foo Shi Hao [mailto:zeon@doramail.com]
> Sent: Thursday, June 14, 2001 8:45 AM
> To: tomcat-user@jakarta.apache.org
> Subject: Using JSP to Save file
> 
> 
> Hey all~!
> Got something to ask. I'm running a simple jsp page as shown 
> below. It has no errors but the file is not being 
> written/created...any ideas?
> 
> <%@ page import="java.io.*"%>
> <html>
> <head><title>File Saver</title></head>
> <body>
> <%
> PrintWriter textFile = null;
> try
> {
> textFile = new PrintWriter(new 
> FileOutputStream("economic.txt"));
> }
> catch(IOException e)
> {
> System.out.println("File I/O Error.");
> } 
> textFile.println("Testing Phase"); 
> textFile.close();
> %> 
> </body>
> </html>
> -- 
> 
> Get your free email from www.doramail.com with 30 Megs of 
> disk space in webhosting and e-mail storage!
> 
> 
> 
> 
> 
> Powered by Outblaze
>