i need to access a configuration file with some properties from a class inside a webapp.
The webapp consist of a servlet that uses another class.
In that class i want to access a configuration file.
Which is the best way?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
you can put a properties file under your
WEB-INF/classesdirectory. in that way it wil be visible on the classpath, then in your java class you can use :