Re: FileInputStream in Servlet
- From: "John C. Bollinger" <jobollin@xxxxxxxxxxx>
- Date: Sat, 31 Dec 2005 00:14:32 -0500
bauerg@xxxxxxx wrote:
I have a servlet, which I want to debug within eclipse. The servlet is reading a config-file on startup, this file is opend with a FileInputStream(filename), but without a path!
I have defined the Tomcat4 for MyEclipse with different HOME and BASE, if I set a fix path (i.e. "c:/file.ext") then everythin works fine, but
without the path, the FileInputStream everytime gives a exception: java.io.FileNotFoundException: file.ext
I have placed the file.ext in many directories, but it never has been found!
Where to hell does Tomcat search for this file???
Please could someone help me? Do I have to place the file in TOMCAT_HOME, TOMCAT_BASE, somwhere under one of this, or what?
As I recall, Tomcat provides working space on a per-webapp basis somewhere under its own directory hierarchy. I believe the location can be configured, in fact. You'll find it in the docs if you read long enough.
But why not make Tomcat tell you instead? Just have a servlet or JSP (running in your debug environment) send the value of the System's "user.dir" property; this should name the directory you want.
-- John Bollinger jobollin@xxxxxxxxxxx .
- References:
- FileInputStream in Servlet
- From: bauerg
- FileInputStream in Servlet
- Prev by Date: Re: Cannot invoke commit when AutoCommit mode is set to true
- Next by Date: Re: Data and File I/O
- Previous by thread: Re: FileInputStream in Servlet
- Next by thread: Implementing FcFs queue with J2SE 5.0
- Index(es):
Relevant Pages
|