1

Possible Duplicate:
Configure Tomcat to use properties file to load DB connection information

I would like to set some values in properties file and put the file in somewhere in tomcat because the property file's values are changeable. I will give only war file and properties file the customer will change values in properties file while using the application.

mail.smtp.host=smtp.gmail.com
mail.smtp.port= 465

This is what is my exact need. I want to set the values for this mail.smtp.host and mail.smtp.port

I want to access these values from servlet.

please help me how to go about.

Regards Tony

Community
  • 1
  • 1
Joe
  • 4,460
  • 19
  • 60
  • 106

1 Answers1

4

Use

servletContext.getRealPath("/");

and then you can navigate to your directory from tomcat

Also See

Community
  • 1
  • 1
jmj
  • 237,923
  • 42
  • 401
  • 438