Re: Tomcat 6: Having the JSP read a file from webapp directory
Steve wrote:
Hi;
I'm running Tomcat 6 as a stand alone service on Windows XP.. I used
the Apache-Tomcat installer ( it was convenient! ).
I have a JSP application that reads in various parameters from a file
in its webapp ( context? ) directory. The webbapp directory is not
the default. I set the webapp directory via
c:\Program Files\Apache Software Foundation\Tomcat 6.0\conf\Catalina
\localhost\myjspapp.xml
The webapp directory for "myjspapp" would be
c:\home\tomcatapps\myjspapp
This directory would contain a file called "useful_params.prop"
myjspapp would read this file ( this is how it has been working and we
are migrating it over from another servlet container software )
The problem is that myjspapp doesn't seem to finding this file
"useful_params.prop".
Is there a way without changing the code for myjspapp to get it to
find that file in c:\home\tomcatapps\myjspapp ?
Refer to the file with a relative path and put it in a place findable by the
class loader, that is, in the web app's classpath. Candidates include
WEB-INF/classes/.
--
Lew