• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Writing to properties file in WEB-INF

 
Zak Nixon
Ranch Hand
Posts: 126
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 65216
95
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Check out ServletContext.getRealPath().
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic