> > I want to plug an API in to a web app. The API has a properties file
> > that has properties defining the relative location of particular
[quoted text clipped - 26 lines]
> -cheers,
> Manish
> > > I want to plug an API in to a web app. The API has a properties file
> > > that has properties defining the relative location of particular
[quoted text clipped - 44 lines]
>
> - Show quoted text -
I would not recommend using relative paths in properties file to look
up resources for a webapp. To give you an example, if I run Tomcat
(installed in c:\jakarta-tomcat) from within Eclipse (installed in c:
\eclipse) and print System.getProperty("user.dir"), it shows c:
\eclipse. The JSP that prints this sits in c:\workspace\myapp\. You
can clearly see all the variables in play here. Best option will be to
use absolute paths for this purpose. If you want context sensitive
paths, then use look up these resources via the classloader
(getResourceAsStream) and use /some_file instead of ./some_file. As
long as some_file is in the classpath, it'll be picked up. I believe
that is how Spring looks up it's configuration files, etc. as well.
-cheers,
Manish
Dundonald - 06 Oct 2007 09:34 GMT
> > > > I want to plug an API in to a web app. The API has a properties file
> > > > that has properties defining the relative location of particular
[quoted text clipped - 56 lines]
> long as some_file is in the classpath, it'll be picked up. I believe
> that is how Spring looks up it's configuration files, etc. as well.
Thanks again Manish.