Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

getRealPath("/") returns null

843840Jun 1 2002 — edited Dec 8 2005
Hello All,

What is the standard mechanism of keeping/getting application specific configuration files ?

I used to create a directory called conf under WEB-INF and keep all my appliation related config files there.

to read them I used to do getServletContext().getRealPath("/") + "/WEB-INF/conf/config.xml"

well this worked for me quite well .. till I moved to another app server (BEA WLS 7.0) there the api getRealPath("/") returns null to me.

Now my appliaction does not work.

I want to know what is the standard way of keeping application specific config files and what is the standard way of reading them (which works accross app servers and servlet engines.)

I searched the web but could not find anything on this subject. please help.

regards,
Abhishek.

PS: I don't want to hard code my path like File fck = new File("c:\my file.hehehe");
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jan 5 2006
Added on Jun 1 2002
13 comments
1,072 views