I would like to deploy multiple independent copies of a specific web application on the same tomcat server under different context paths. Each web application will need different configuration parameters (database name, password, etc.), but I would like the wars to be the same.
My plan was for the application to launch its context path at startup, and then read the specific .properties file outside of tomcat, identified by the context path. For example, if the war was deployed to {tomcat path} / webapps / pineapple, then I would like to read /config/pineapple.properties
I tried to find a way to load an instance of ServletContext through spring (3), but all the tips I have seen so far use the deprecated ServletContextFactoryBean.
Is there a better way to get the entered context path or a better way to load external files based on the context path?
source share