在servlet 或者 jsp 中调用:
try{
MBeanServer server = MBeanUtils.createServer();
ObjectName name = new ObjectName("Catalina:type=Service,serviceName=Catalina");
server.invoke(name, "stop", new Object[0], new String[0]);
} catch (Exception e) {
e.printStackTrace();
}
window tomcat 6 调试通过。
http://web.archiveorange.com/archive/v/yBMRzHgse3wp4GzLy4do
http://www.mulesoft.com/tomcat-jmx
http://tomcat.apache.org/tomcat-7.0-doc/manager-howto.html
http://tomcat.apache.org/tomcat-7.0-doc/monitoring.html#JMXAccessorInvokeTask:__invoke_MBean_operation_Ant_task
http://tomcat.apache.org/tomcat-7.0-doc/funcspecs/fs-admin-opers.html#Context
http://www.mulesoft.com/tomcat-manager
http://www.java-tutorial.ch/tomcat/tomcat-manager-access