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 EJB 3 in Action this week in the EJB and other Java EE Technologies 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: 60048

Check out ServletContext.getRealPath().

[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
I agree. Here's the link:
subject: Writing to properties file in WEB-INF
Similar Threads
Writing properties to same properties file .
Using Properties File in struts
Best place for .properties file?
Load Property file in servlet or jsp
Writing properties files, JARs, packages, etc.