Denees
Denees

Reputation: 9208

Root path in the *.properties file

I have a *.properties file with some configurations in it, there I have a "file=" key where I need to specify the path to the file. Now, my file is situated in root folder of my web application. How can I specify root of my web application in *.proprietes file?

Something like

file=${root}/file.extension

Upvotes: 0

Views: 1533

Answers (1)

epoch
epoch

Reputation: 16625

When you read your property file in the web application, programatically replace ${root} with getServletContext().getRealPath("/");

Upvotes: 1

Related Questions