What would happen if someone writes System.exit()
in a servlet would the server or the application crash?
views:
111answers:
3Well, I would hope that most would be running with a security manager and be configured to restrict this. If so, then the answer is No. So the correct answer is, depends on if a security manager is in use and the security policy is correctly configured/restricted.
Kevin Brock
2010-05-20 10:38:12
+7
A:
Maybe! The container should have modified the security manager (SecurityManager.checkExit()
) so the call may result in an AccessControlException
. No webapp should be able to shutdown the server.
Arne Burmeister
2010-05-20 07:16:55
+2
A:
There is an answer to this question already here: http://tomcat.apache.org/tomcat-5.5-doc/security-manager-howto.html
J K
2010-05-20 08:30:22