I am developing an environment management console, in which users can view deployments and change a properties file accessed as a servlet resource, then reload the classes and resources. It seems like Tomcat’s ManagerServlet would be a perfect tool to do this, but I want to be able to access it from my post method in a separate servlet which saves the changes to the properties file and then, ideally, reloads the resources. How can I access the ManagerServlet‘s reload functionality from my servlet?
I am developing an environment management console, in which users can view deployments and
Share
Well, you can for instance access it via the http protocol:
http://localhost:8080/manager/text/reload?path=/examples. Here is the link to documentation: http://tomcat.apache.org/tomcat-7.0-doc/manager-howto.htmlBut, tomcat provides dozen of MBeans to manage your tomcat server. I would recommend you to use them to manage / reload the servlets. You can launch
jconsoleon your computer and plug it to a running tomcat. You’ll be able to browse the MBeans availables on tomcat server and to test them.BTW, be aware than if you have any memory leak in your application or dependencies, you won’t be able to reload the contexts indefinitely.
HIH