File I/O in a JSP in Tomcat
Posted on 2005-03-22
I have a JSP page that was initially developed in JRun and I was able to access the file:
by using the following relative reference:
BufferedWriter out1 = new BufferedWriter(new FileWriter(".\SJRF\logs\JRC_4B0DBFAA59087A64ED279B60FEBBE837.log",true));
When I try the same thing in Tomcat 5.5.4, it is unable to find the path. I know ideally I should be using the servlet engine logging mechanism, but for now I'd like to know if there's some way in tomcat to reference a file from a location relative to where the webapp is deployed (or even relative to where tomcat is installed).