File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Servlets and the fly likes Writing to properties file in WEB-INF Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of REST with Spring (video course) this week in the Spring forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "Writing to properties file in WEB-INF" Watch "Writing to properties file in WEB-INF" New topic

Writing to properties file in WEB-INF

Zak Nixon
Ranch Hand

Joined: Sep 27, 2003
Posts: 126
This is an addedum to my previous problem: Writing properties to file.

Now, I am trying to read the file located in my
WEB-INF directory. Whenever I try to read the file though, using
I take the absolute path of this file, and it turns out to be
C:\ Is there anyway I can specify the path to be
in the WEB-INF directory by not specifying the absolute path?


Bear Bibeault
Author and ninkuma

Joined: Jan 10, 2002
Posts: 63548

Check out ServletContext.getRealPath().

[Asking smart questions] [About Bear] [Books by Bear]
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
subject: Writing to properties file in WEB-INF
It's not a secret anymore!