Hi. i have one java file that uses .properties file. but it couldn't find the .properties file. my dir is like this: tomcat/webapps/myapp/WEB-INF/classes/com/example/web/a.class
When you try to load files the way you do, it tries to load the file from the 'current directory'. The problem here is that the current directory keeps moving depending on how you start your application, and it's not very useful in a web application anyway.
In web based applications you should keep your properties file inside the application and there are two common ways to do this. You'll find a useful discussion here.
Dave
zelynn goay
Ranch Hand
Joined: Jan 09, 2005
Posts: 30
posted
0
Hi. Thanks for the guidelines. Managed to access the .properties file already.