specifying path for file to be read by servlet with Tomcat
From: Yang Xiao (yang2002_99_at_yahoo.com)
Date: 02/08/04
- Next message: seatizen: "Re: Java3D - picking"
- Previous message: Jon A. Cruz: "Re: visual j++ and javax?"
- Next in thread: Chris Smith: "Re: specifying path for file to be read by servlet with Tomcat"
- Reply: Chris Smith: "Re: specifying path for file to be read by servlet with Tomcat"
- Reply: Andrew Thompson: "Re: specifying path for file to be read by servlet with Tomcat"
- Reply: hiwa: "Re: specifying path for file to be read by servlet with Tomcat"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: 7 Feb 2004 16:41:18 -0800
Hi everybody,
I'm trying to read a txt file to be used by a servlet to display
posting topics, I'm running Tomcat 5.0 on Win2k.
(new FileInputStream("C:/JAVA/Topics.txt"));
This seems to work fine, but not portable, but none of the following
attempts to use a relative path works,
(new FileInputStream("Topics.txt")) -- classes/Topics.txt
(new FileInputStream "../Topics.txt")); -- classes/Topics.txt
(new FileInputStream "/Topics.txt")); -- ROOT/Topics.txt
(new FileInputStream "http://localhost/Topics.txt")); --
ROOT/Topics.txt
Please help!
Thanks,
Yang
- Next message: seatizen: "Re: Java3D - picking"
- Previous message: Jon A. Cruz: "Re: visual j++ and javax?"
- Next in thread: Chris Smith: "Re: specifying path for file to be read by servlet with Tomcat"
- Reply: Chris Smith: "Re: specifying path for file to be read by servlet with Tomcat"
- Reply: Andrew Thompson: "Re: specifying path for file to be read by servlet with Tomcat"
- Reply: hiwa: "Re: specifying path for file to be read by servlet with Tomcat"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|