I looked at this post,and they said to use a batch script to restart a tomcat server using a webapp. The issue is that if you use Runtime.exec("batch.bat"), once you do the kill for the tomcat server, the server dies and the runtime dies.
I did a quick test of this by adding some prints to my batch file to be sure:
echo "lol" > file1.txt
net stop tomcatservice
echo "lol2" > file2.txt
net start tomcatservice
echo "lol3" > file3.txt
Only file1 was created as suspected.
Is there a way to do what I want? Is there a way for me to restart the tomcat server on a schedule through code in my webapp?