If you are only reading the file, you could also put it in your
$/WEB-INF/classes folder and use the class loader to get an input
stream. That way, if you jar/war the file up, it will still find it.
Like this:
InputStream is =
Thread.
currentThread().
getContextClassLoader().
getResourceAsStream("config.txt");
Also, a change to config.txt will trigger a reload, so in development,
you do not need to restart or otherwise force the file to get reloaded.
Not sure if this makes sense in your case, but it is another option.
Larry
>>> [EMAIL PROTECTED] 08/12/02 16:14 PM >>>
getServletContext.getRealPath("/config.txt") will return the path to
config.txt in the root of your apps directory.
> -----Original Message-----
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED]]
> Sent: Monday, August 12, 2002 5:00 PM
> To: Tomcat Users List
> Subject: Quick Question
>
>
> Hi all,
>
> I wrote a simple java bean that reads a txt file, the problem
> is where do
> I need to put the txt file??...
> What is the default directory in Tomcat??....
>
> when I put something like this in my java bean :
> FileReader("config.txt")....
> Where does tomcat look for that file?....
>
> thanks
> Alex
>
--
To unsubscribe, e-mail:
<mailto:[EMAIL PROTECTED]>
For additional commands, e-mail:
<mailto:[EMAIL PROTECTED]>
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>