I have created a properties file under the root of my project. I would like to read the file to retrieve some config values. Could some one point out the path to determine the file.
I am able to read the file when I place the file under WEB-INF/classes/test.properties with the below code.
Thanks in advance for your help. It is a JSP / Struts application.
Ananth Ram wrote:I am able to read the file when I place the file under WEB-INF/classes/test.properties with the below code.
Good. And that's exactly what you should be doing. So it works? Then what is your question? You mentioned a "project", which isn't a technical term in either JSP or Struts as far as I know.
Root--> test.properties, file included.
Root --> src is the folder where my struts action package and other java code resides.
Root --> web is the folder where the jsp, css/images,etc resides.
I want to place the file under the root folder and read the same. Please let me know if I am not clear.
I see. So this "project" is in some kind of IDE then? In that case this is a question about that IDE... whatever it is. Is there a reason you aren't telling us that? At any rate let me move this post to the IDEs forum.
By the way I have found that artifacts under the "src" folder get compiled into artifacts under the WEB-INF/classes folder in my IDE environment. Yours might work the same way.
There is no beard big enough to make me comfortable enough with my masculinity to wear pink. Tiny ad:
a bit of art, as a gift, that will fit in a stocking