简体   繁体   中英

How can I create a new shared folder in Tomcat 8 and load my properties file from that

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.

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?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM