In fact, your code works. Indeed, the file
"economic.txt" is located under "<tomcat_home>\bin"

KC



         "Foo Shi Hao" <[EMAIL PROTECTED]> | Block
Address | Add to Address Book
      To:
         [EMAIL PROTECTED]
    Date:
         Thu, 14 Jun 2001 20:45:05 +0800
  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!



__________________________________________________
Do You Yahoo!?
Spot the hottest trends in music, movies, and more.
http://buzz.yahoo.com/

Reply via email to