This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
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 Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "Writing to properties file in WEB-INF" Watch "Writing to properties file in WEB-INF" New topic
Author

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 db.properties 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:\db.properties. Is there anyway I can specify the path to be
in the WEB-INF directory by not specifying the absolute path?

Thanks

Zak
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60785
    
  65

Check out ServletContext.getRealPath().


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