Hello Peter
Use

where conf is the config object.


String  sAttr = conf.getServletContext().getRealPath("/") +
"NameOfFile.txt";

FileOutputStream fw = new FileOutputStream(sNameOfTextFile, false);


Regards
Rohit Parik
Netweb Software, India
Ph:   +91-265-301424
        +91-265-314729
Fax: +91-265-314756
email : [EMAIL PROTECTED]

  ----- Original Message -----
  From: Peter Barraud
  To: [EMAIL PROTECTED]
  Sent: Monday, April 30, 2001 9:39 AM
  Subject: file streams in jsp


  Hi,
  I am using tomcat 3.1 (windows) 1 to run jsp file. In the webapps folder I
  have created a subfolder
  "jsp" in a .jsp file I need to save some data to a file. However when I
use
  this line:
  FileOutputStream outstream = new FileOutputStream("myfile.dat");
  the file is saved in the tomcat/bin folder. Is there any way I can save
this
  file in the same folder that contains my jsp file.
  Thanx in advance.


___________________________________________________________________________
  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

Reply via email to