0

I have a Spring MVC web application. I am now trying to externalize all the properties to keep it independent of the war file. I am trying to load some properties from my application.properties file. Also I want to load my database credentials also like this. Is there any way I can do this?

I have in my root-contxt.xml file,

I tried the following: Adding a property file in the shared folder in tomcat 8 and using it in a Spring MVC web application

But I have not found a solution yet.

Community
  • 1
  • 1

1 Answers1

0

You can very well use PropertyPlaceholderConfigurer in Spring MVC to externalize properties file.

Please seethe post below which explains it in detail:

PropertyPlaceholderConfigurer in Spring MVC

Please see below post as well which explains it with example:

Spring application context external properties?

Community
  • 1
  • 1
shankarsh15
  • 1,947
  • 1
  • 11
  • 16
  • thanks for the reply, I am trying to add the properties in the tomcat shared folder. –  May 16 '16 at 03:00