Tomcat / Spring - Restart Webapp

What is the best approach to use to restart the Spring web application running on Tomcat programmatically?

I have two specific scneario that I am considering:

Installation The user configures the system, provides options for connecting to the database, etc. After that, the Spring data contexts are invalid and I would like to restart to reinitialize with the correct parameters.

Updgrading The application has downloaded the update and needs to be installed independently. This may include deploying an updated WAR and updating databases. For now, it seems that restarting the application inside tomcat is the best way to go.

What approaches should I use? I would like to do this programmatically, so the user does not need to log in directly on the server.

+3
source share
1 answer

The Tomcat manager application is designed for this kind of thing:
http://tomcat.apache.org/tomcat-5.5-doc/manager-howto.html

I used it through ant, as part of my build script, and really loved it.

+1
source

Source: https://habr.com/ru/post/1749965/


All Articles